Skip to content

Find the maximum value in a list

Source code

Description

Find the maximum value in a list

Usage

<Expr>$list$max()

Value

Expr

Examples

library("polars")

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