Count the number of NaN's

from pandas import DataFrame
import numpy as np

Create a pandas DataFrame.

df = DataFrame({'a': [8, np.nan, 23], 
                'b': [7, 8, 4], 
                'c': [400, 83, 98]},
                index=["one", "two", "three"])
df
a b c
one 8.0 7 400
two NaN 8 83
three 23.0 4 98

Count the number of NaN's in each column.

df.isnull().sum()
a    1
b    0
c    0
dtype: int64

Count the number of NaN's in each row.

df.isnull().sum(axis=1)
one      0
two      1
three    0
dtype: int64

If you spot any errors please let me know on twitter.