Skip to content

Drop NaN

Source code

Description

Drop NaN

Usage

<Expr>$drop_nans()

Details

Note that NaN values are not null values. Null values correspond to NA in R.

Value

Expr

See Also

drop_nulls()

Examples

library("polars")

pl$DataFrame(list(x = c(1, 2, NaN, NA)))$select(pl$col("x")$drop_nans())
#> shape: (3, 1)
#> ┌──────┐
#> │ x    │
#> │ ---  │
#> │ f64  │
#> ╞══════╡
#> │ 1.0  │
#> │ 2.0  │
#> │ null │
#> └──────┘