Skip to content

Get a boolean mask of the local minimum peaks

Description

Get a boolean mask of the local minimum peaks

Usage

<Expr>$peak_min()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(x = c(1, 2, 3, 2, 3, 4, 5, 2))
df$with_columns(peak_min = pl$col("x")$peak_min())
#> shape: (8, 2)
#> ┌─────┬──────────┐
#> │ x   ┆ peak_min │
#> │ --- ┆ ---      │
#> │ f64 ┆ bool     │
#> ╞═════╪══════════╡
#> │ 1.0 ┆ false    │
#> │ 2.0 ┆ false    │
#> │ 3.0 ┆ false    │
#> │ 2.0 ┆ true     │
#> │ 3.0 ┆ false    │
#> │ 4.0 ┆ false    │
#> │ 5.0 ┆ false    │
#> │ 2.0 ┆ false    │
#> └─────┴──────────┘