count missing values dataframe code example
Example 1: count missing values by column in pandas
df.isna().sum()
Example 2: count rows with nan pandas
np.count_nonzero(df.isnull().values)
np.count_nonzero(df.isnull()) # also works
df.isna().sum()
np.count_nonzero(df.isnull().values)
np.count_nonzero(df.isnull()) # also works