Dropna

class of dascore.proc.basic
inherits from: PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

Dropna(
    *args ,
    dim: Any ,
    how: Any = any,
    include_inf: Any = True,
)-> None

Return a patch with nullish values dropped along dimension.

Parameters

Parameter Description
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.
include_inf If True, drop all non-finite values.
Note

When include_inf is False, “nullish” is defined by pandas.isnull. When include_inf is True (default), “nullish” includes non-finite values (NaN, inf, -inf) as determined by numpy.isfinite

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")

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
get_metadata Return the metadata as it is, and the axis to drop along.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return the kept data and which labels they are; the data if none drop.
dropna Return a patch with nullish values dropped along dimension.
reconcile Return the patch of the kept labels.
run Run the operation: check, get_metadata, kernel, reconcile, record.