Check if elements are not NULL
Description
Check if elements are not NULL
Usage
<Expr>$is_not_null()
Value
A polars expression
Examples
library("polars")
df <- pl$DataFrame(
a = c(1, 2, NA, 1, 5),
b = c(1, 2, NaN, 1, 5)
)
df$with_columns(
a_not_null = pl$col("a")$is_not_null(),
b_not_null = pl$col("b")$is_not_null()
)
#> shape: (5, 4)
#> ┌──────┬─────┬────────────┬────────────┐
#> │ a ┆ b ┆ a_not_null ┆ b_not_null │
#> │ --- ┆ --- ┆ --- ┆ --- │
#> │ f64 ┆ f64 ┆ bool ┆ bool │
#> ╞══════╪═════╪════════════╪════════════╡
#> │ 1.0 ┆ 1.0 ┆ true ┆ true │
#> │ 2.0 ┆ 2.0 ┆ true ┆ true │
#> │ null ┆ NaN ┆ false ┆ true │
#> │ 1.0 ┆ 1.0 ┆ true ┆ true │
#> │ 5.0 ┆ 5.0 ┆ true ┆ true │
#> └──────┴─────┴────────────┴────────────┘