polars.Expr.last
-
Get the last value.
- Parameters:
-
- ignore_nulls
-
Ignore null values (default
False). If set toTrue, the last non-null value is returned, otherwiseNoneis returned if no non-null value exists.
Examples
>>> df = pl.DataFrame({"a": [1, 3, 2]}) >>> df.select(pl.col("a").last()) shape: (1, 1) ┌─────┐ │ a │ │ --- │ │ i64 │ ╞═════╡ │ 2 │ └─────┘
Expr.last(
*,
ignore_nulls: bool = False,
) → Expr
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.last.html