Return a new Series with missing values removed.
See the User Guide for more on which values are considered missing, and how to work with missing data.
Unused. Parameter needed for compatibility with DataFrame.
If True, do operation inplace and return None.
Not in use. Kept for compatibility.
If True, the resulting axis will be labeled 0, 1, …, n - 1.
Added in version 2.0.0.
Series with NA entries dropped from it or None if inplace=True.
See also
Series.isnaIndicate missing values.
Series.notnaIndicate existing (non-missing) values.
Series.fillnaReplace missing values.
DataFrame.dropnaDrop rows or columns which contain NA values.
Index.dropnaDrop missing indices.
Examples
>>> ser = pd.Series([1., 2., np.nan])
>>> ser
0 1.0
1 2.0
2 NaN
dtype: float64
Drop NA values from a Series.
>>> ser.dropna()
0 1.0
1 2.0
dtype: float64
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 NaN
1 2
2 NaT
3
4 None
5 I stay
dtype: object
>>> ser.dropna()
1 2
3
5 I stay
dtype: object
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Series.dropna.html