Skip to content

Get minimum value with NaN

Source code

Description

Get minimum value, but returns NaN if there are any.

Usage

<Expr>$nan_min()

Value

Expr

Examples

library("polars")

pl$DataFrame(x = c(1, NA, 3, NaN, Inf))$
  with_columns(nan_min = pl$col("x")$nan_min())
#> shape: (5, 2)
#> ┌──────┬─────────┐
#> │ x    ┆ nan_min │
#> │ ---  ┆ ---     │
#> │ f64  ┆ f64     │
#> ╞══════╪═════════╡
#> │ 1.0  ┆ NaN     │
#> │ null ┆ NaN     │
#> │ 3.0  ┆ NaN     │
#> │ NaN  ┆ NaN     │
#> │ inf  ┆ NaN     │
#> └──────┴─────────┘