import dascore as dc
# load an example patch which has some NaN values.
= dc.get_example_patch("patch_with_null")
patch # Replace all occurences of NaN with 0
= patch.fillna(0)
out # Replace all occurences of NaN with 5
= patch.fillna(5) out
fillna
fillna(
patch: Patch ,
value ,
)-> ‘PatchType’
Return a patch with nullish values replaced by a value.
Parameters
Parameter | Description |
---|---|
patch | The patch which may contain nullish values. |
value | The value to replace nullish values with. |
Note
“nullish” is defined by pandas.isnull
.