Fill nulls
Description
Fill null values (which correspond to NA
in R) using the
specified value or strategy.
Usage
<DataFrame>$fill_null(fill_value)
Arguments
fill_value
|
Value to fill nulls with. |
Value
DataFrame
Examples
library("polars0")
df = pl$DataFrame(
a = c(1.5, 2, NA, 4),
b = c(1.5, NA, NA, 4)
)
df$fill_null(99)
#> shape: (4, 2)
#> ┌──────┬──────┐
#> │ a ┆ b │
#> │ --- ┆ --- │
#> │ f64 ┆ f64 │
#> ╞══════╪══════╡
#> │ 1.5 ┆ 1.5 │
#> │ 2.0 ┆ 99.0 │
#> │ 99.0 ┆ 99.0 │
#> │ 4.0 ┆ 4.0 │
#> └──────┴──────┘
#> shape: (4, 2)
#> ┌─────┬─────┐
#> │ a ┆ b │
#> │ --- ┆ --- │
#> │ f64 ┆ f64 │
#> ╞═════╪═════╡
#> │ 1.5 ┆ 1.5 │
#> │ 2.0 ┆ 2.5 │
#> │ 2.5 ┆ 2.5 │
#> │ 4.0 ┆ 4.0 │
#> └─────┴─────┘