find the number of nan per column pandas

In [1]: s = pd.Series([1,2,3, np.nan, np.nan])

In [4]: s.isna().sum()   # or s.isnull().sum() for older pandas versions
Out[4]: 2

Here is what the above code is Doing:
1. We create a Series with some missing values.
2. We use the isna() method to check for missing values.
3. We use the sum() method to count the number of missing values.