Given a pandas dataframe containing possible NaN values scattered here and there:
Question: How do I determine which columns contain NaN values? In
Both of these should work:
df.isnull().sum() df.isna().sum()
DataFrame methods isna() or isnull() are completely identical.
isna()
isnull()
Note: Empty strings '' is considered as False (not considered NA)
''