import dascore as dc
# load an example patch which has some NaN values.
= dc.get_example_patch("patch_with_null")
patch # drop all time labels that have a single null value
= patch.dropna("time", how="any")
out # drop all distance labels that have all null values
= patch.dropna("distance", how="all") out
dropna
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
.