Skip to content

Get the index of the maximal value

Description

Get the index of the maximal value

Usage

<Expr>$arg_max()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(a = c(20, 10, 30))
df$select(pl$col("a")$arg_max())
#> shape: (1, 1)
#> ┌─────┐
#> │ a   │
#> │ --- │
#> │ u32 │
#> ╞═════╡
#> │ 2   │
#> └─────┘