Skip to content

Find the minimum value in an array

Source code

Description

Find the minimum value in an array

Usage

<Expr>$arr$min()

Details

This method is only available with the "nightly" feature. See polars_info() for more details.

Value

Expr

Examples

library(polars)

df = pl$DataFrame(
  values = list(c(1, 2), c(3, 4), c(5, 6)),
  schema = list(values = pl$Array(pl$Float64, 2))
)
df$with_columns(min = pl$col("values")$arr$min())
#> shape: (3, 2)
#> ┌───────────────┬─────┐
#> │ values        ┆ min │
#> │ ---           ┆ --- │
#> │ array[f64, 2] ┆ f64 │
#> ╞═══════════════╪═════╡
#> │ [1.0, 2.0]    ┆ 1.0 │
#> │ [3.0, 4.0]    ┆ 3.0 │
#> │ [5.0, 6.0]    ┆ 5.0 │
#> └───────────────┴─────┘