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