Get the index of the minimal value in list
Description
Get the index of the minimal value in list
Usage
<Expr>$list$arg_min()
Value
Expr
Examples
library("polars")
df = pl$DataFrame(list(s = list(1:2, 2:1)))
df$with_columns(
arg_min = pl$col("s")$list$arg_min()
)
#> shape: (2, 2)
#> ┌───────────┬─────────┐
#> │ s ┆ arg_min │
#> │ --- ┆ --- │
#> │ list[i32] ┆ u32 │
#> ╞═══════════╪═════════╡
#> │ [1, 2] ┆ 0 │
#> │ [2, 1] ┆ 1 │
#> └───────────┴─────────┘