Skip to content

Get the minimum value with NaN

Description

This returns NaN if there are any.

Usage

<Expr>$nan_min()

Value

A polars expression

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     │
#> └──────┴─────────┘