TableFrame.fill_null
methodView source ↗
def fill_null(value: Any | TdExpr | None = None) -> TdLazyFrame
Categories: manipulation
Replace all null values in the TableFrame with the given value.
Parameters
parameter
valueThe value to replace null with.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
┌──────┬──────┐
│ x ┆ y │
│ --- ┆ --- │
│ f64 ┆ f64 │
╞══════╪══════╡
│ 1.0 ┆ 2.0 │
│ 2.0 ┆ 2.0 │
│ NaN ┆ NaN │
│ 4.0 ┆ NaN │
│ 5.0 ┆ null │
│ null ┆ null │
└──────┴──────┘
>>>
>>> tf.fill_null(20)
>>>
┌──────┬──────┐
│ x ┆ y │
│ --- ┆ --- │
│ f64 ┆ f64 │
╞══════╪══════╡
│ 1.0 ┆ 2.0 │
│ 2.0 ┆ 2.0 │
│ NaN ┆ NaN │
│ 4.0 ┆ NaN │
│ 5.0 ┆ 20.0 │
│ 20.0 ┆ 20.0 │
└──────┴──────┘