pyspark.pandas.Series.notna

Series.notna() → IndexOpsLike

Detect existing (non-missing) values. Return a boolean same-sized object indicating if the values are not NA. Non-missing values get mapped to True. Characters such as empty strings ‘’ or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True). NA values, such as None or numpy.NaN, get mapped to False values.

Returns
Series or IndexMask of bool values for each element in Series

that indicates whether an element is not an NA value.

Examples

Show which entries in a Series are not NA.

>>> ser = ps.Series([5, 6, np.NaN])
>>> ser
0    5.0
1    6.0
2    NaN
dtype: float64
>>> ser.notna()
0     True
1     True
2    False
dtype: bool
>>> ser.rename("a").to_frame().set_index("a").index.notna()  
Index([True, True, False], dtype='bool', name='a')