'How do I identify nan values in pandas data frame where all variables are categorical?

I have a data frame with all categorical variables and when I apply df.isnull().sum(axis=0). or even df.isna gives 0. to get all the nans column wise I get an output which shows 0 for all columns however I can see many missing values when I do df.head(50). I think it is because it is obj types it is not getting identified. Is there a workaround?



Solution 1:[1]

You can check Null values with the following code:

print(df.isnull().any())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ElhamMotamedi