dropna

function of dascore.proc.basic source

dropna(
    patch: Patch ,
    dim ,
    how: Literal[‘any’, ‘all’] = any,
)-> ‘PatchType’

Return a patch with nullish values dropped along dimension.

Parameters

Parameter Description
patch The patch which may contain nullish values.
dim The dimension along which to drop nullish values.
how “any” or “all”. If “any” drop label if any null values.
If “all” drop label if all values are nullish.
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")
# drop all time labels that have a single null value
out = patch.dropna("time", how="any")
# drop all distance labels that have all null values
out = patch.dropna("distance", how="all")