modin.pandas.DataFrame.dropna¶
- DataFrame.dropna(*, axis: Axis = 0, how: str | lib.NoDefault = _NoDefault.no_default, thresh: int | lib.NoDefault = _NoDefault.no_default, subset: IndexLabel = None, inplace: bool = False, ignore_index: bool = False) Self[source]¶
Remove missing values.
- Parameters:
axis ({0 or 'index', 1 or 'columns'}, default 0) –
Determine if rows or columns which contain missing values are removed.
0, or ‘index’ : Drop rows which contain missing values.
1, or ‘columns’ : Drop columns which contain missing value.
Only a single axis is allowed.
how ({'any', 'all'}, default 'any') –
Determine if row or column is removed from DataFrame, when we have at least one NA or all NA.
’any’ : If any NA values are present, drop that row or column.
’all’ : If all values are NA, drop that row or column.
thresh (int, optional) – Require that many non-NA values. Cannot be combined with how.
subset (column label or sequence of labels, optional) – Labels along other axis to consider, e.g. if you are dropping rows these would be a list of columns to include.
inplace (bool, default False) – Whether to modify the DataFrame rather than creating a new one.
- Returns:
DataFrame with NA entries dropped from it or None if
inplace=True.- Return type:
See also
DataFrame.isnaIndicate missing values.
DataFrame.notnaIndicate existing (non-missing) values.
DataFrame.fillnaReplace missing values.
Series.dropnaDrop missing values.
Index.dropnaDrop missing indices.
Examples
Drop the rows where at least one element is missing.
Drop the rows where all elements are missing.
Keep only the rows with at least 2 non-NA values.
Define in which columns to look for missing values.
Keep the DataFrame with valid entries in the same variable.