If you want to count the NaN values in a column in pandas DataFrame you can use the isna() method or it's alias isnull() method the isnull() method is compatible with older pandas versions < 0.21.0 and then sum to count the NaN values. For one column:
import pandas as pd
column_value = pd.Series([1,2,3, np.nan, np.nan])
column_value.isna().sum()
If your code has many columns then you can use the following code to count the NaN values this code will return you the name of the column which contains the NaN value as well as the data types:-
import pandas as pd
df = pd.DataFrame({'a':[1,2,np.nan], 'b':[np.nan,1,np.nan]})
df.isna().sum()