fillna

function of dascore.proc.basic source

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.

Examples

import dascore as dc
# load an example patch which has some NaN values.
patch = dc.get_example_patch("patch_with_null")
# Replace all occurences of NaN with 0
out = patch.fillna(0)
# Replace all occurences of NaN with 5
out = patch.fillna(5)