Skip to main content
Version: 1.2.0

TableFrame.fill_null

def fill_null(value: Any | Expr | None = None) -> TableFrame

Categories: manipulation

Replace all null values in the TableFrame with the given value.

Parameters

parameter
value

The value to replace null with.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
┌──────┬──────┐
│ x ┆ y │
------
│ f64 ┆ f64 │
╞══════╪══════╡
1.02.0
2.02.0
│ NaN ┆ NaN │
4.0 ┆ NaN │
5.0 ┆ null │
│ null ┆ null │
└──────┴──────┘
>>>
>>> tf.fill_null(20)
>>>
┌──────┬──────┐
│ x ┆ y │
------
│ f64 ┆ f64 │
╞══════╪══════╡
1.02.0
2.02.0
│ NaN ┆ NaN │
4.0 ┆ NaN │
5.020.0
20.020.0
└──────┴──────┘