modin.pandas.Series.dropna¶

Series.dropna(*, axis: Axis = 0, inplace: bool = False, how: str | NoDefault = _NoDefault.no_default)[source]¶

Return a new Series with missing values removed.

Parameters:
  • axis ({0 or 'index'}) – Unused. Parameter needed for compatibility with DataFrame.

  • inplace (bool, default False) – If True, do operation inplace and return None.

  • how (str, optional) – Not in use. Kept for compatibility.

Returns:

Series with NA entries dropped from it or None if inplace=True.

Return type:

Snowpark pandas Series or None

See also

Series.isna

Indicate missing values.

Series.notna

Indicate existing (non-missing) values.

Series.fillna

Replace missing values.

DataFrame.dropna

Drop rows or columns which contain NA values.

Index.dropna

Drop missing indices.

Examples

>>> ser = pd.Series([1., 2., np.nan])
>>> ser
0    1.0
1    2.0
2    NaN
dtype: float64
Copy

Drop NA values from a Series.

>>> ser.dropna()
0    1.0
1    2.0
dtype: float64
Copy

Keep the Series with valid entries in the same variable.

>>> ser.dropna(inplace=True)
>>> ser
0    1.0
1    2.0
dtype: float64
Copy

Empty strings are not considered NA values. None is considered an NA value.

>>> ser = pd.Series([np.nan, 2, pd.NaT, '', None, 'I stay'])
>>> ser  
0      None
1         2
2      None
3
4      None
5    I stay
dtype: object
>>> ser.dropna()  
1         2
3
5    I stay
dtype: object
Copy