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