Examples
Scalar arguments (including strings) result in a scalar boolean.
import numpy as np
import pandas as pd
pd.notna('cat')
pd.notna(np.nan)
ndarrays result in an ndarray of booleans.
array = np.array([[3, np.nan, 4], [6, 7, np.nan]])
array
pd.notna(array)
For indexes, an ndarray of booleans is returned.
index = pd.DatetimeIndex(["2019-05-02", "2019-05-04", None,
"2019-05-07"])
index
pd.notna(index)
For Series and DataFrame, the same type is returned, containing booleans.
df = pd.DataFrame([['fox', 'bee', 'lion'], ['cat', None, 'fly']])
df
pd.notna(df)
pd.notna(df[1])