Skip to content

Compute the miminum value in every sub-list

Description

Compute the miminum value in every sub-list

Usage

<Expr>$list$min()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(values = list(c(1, 2, 3, NA), c(2, 3), NA))
df$with_columns(min = pl$col("values")$list$min())
#> shape: (3, 2)
#> ┌────────────────────┬──────┐
#> │ values             ┆ min  │
#> │ ---                ┆ ---  │
#> │ list[f64]          ┆ f64  │
#> ╞════════════════════╪══════╡
#> │ [1.0, 2.0, … null] ┆ 1.0  │
#> │ [2.0, 3.0]         ┆ 2.0  │
#> │ [null]             ┆ null │
#> └────────────────────┴──────┘