polars.Expr.cummin#

Expr.cummin(*, reverse: bool = False) Self[source]#

Get an array with the cumulative min computed at every element.

Parameters:
reverse

Reverse the operation.

Examples

>>> df = pl.DataFrame({"a": [1, 2, 3, 4]})
>>> df.select(
...     [
...         pl.col("a").cummin(),
...         pl.col("a").cummin(reverse=True).alias("a_reverse"),
...     ]
... )
shape: (4, 2)
┌─────┬───────────┐
│ a   ┆ a_reverse │
│ --- ┆ ---       │
│ i64 ┆ i64       │
╞═════╪═══════════╡
│ 1   ┆ 1         │
│ 1   ┆ 2         │
│ 1   ┆ 3         │
│ 1   ┆ 4         │
└─────┴───────────┘