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