Skip to main content
Version: 1.0.0

TableFrame.fill_nan

def fill_nan(value: int | float | Expr | None) -> TableFrame

Categories: manipulation

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

Parameters

parameter
value

The value to replace NaN 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_nan(10)
>>>
┌──────┬──────┐
│ x ┆ y │
------
│ f64 ┆ f64 │
╞══════╪══════╡
1.02.0
2.02.0
10.010.0
4.010.0
5.0 ┆ null │
│ null ┆ null │
└──────┴──────┘