pandas.Series.dropna¶
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.
- param axis
- {0 or ‘index’}, default 0
There is only one axis to drop values from.
- param inplace
- bool, default False
If True, do operation inplace and return None. **kwargs Not in use.
- return
Series Series with NA entries dropped from it.
Limitations¶
Parameter
inplace
is currently unsupported by Intel Scalable Dataframe Compiler
Examples¶
Return a new Series with missing values removed.¶
import numpy as np
import pandas as pd
from numba import njit
@njit
def series_dropna():
s = pd.Series([4, np.nan, 2, 1])
return s.dropna()
print(series_dropna())
$ python ./series/series_dropna.py
0 4.0
2 2.0
3 1.0
dtype: float64
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.
Return Index without NA/NaN values