The NaN values in a DataFrame object can be identified using the .isnull() method. Any True value means that the item at that location is a NaN value:
We can use the fact that the .sum() method treats True as 1 and False as 0 to determine the number of NaN values in a DataFrame object:
Applying .sum() to the resulting series gives the total number of NaN values in the original DataFrame object:
This is ...