adult_data.isnull().sum() # it only shows non-na values
adult_data.count() # it only shows non-na values
To fetch all rows with null values
adult_data[adult_data.isnull().any(axis=1)].head(5) # fetching only first 5 rows
To fetch all rows with one specific column having null values
adult_data[adult_data["workclass"].isnull()].head(5) # fetching only first 5 rows
Go back to data collection team and try to find out if we can get the missing data somehow. There may be a chance that data was lost because of some reason while passing it to you. Try to find out if Missing data follows a pattern(like only certain area's data is missing, data is missing for salary of certain type of individual because they prefer not to share it) because there may be a important infirmation hidden.
Impute the missing value with a mean value of similar records. If you find a record with missing value, try to find similar records. and see what these records are having as a value. You can try to impute mean value or the value which is occuring maximum number of times.
For example in this case if see row index 88th, maritarl-status is NaN. You can replace it with value which records with similar age range and relationship status as 'Not-in-family' are having.
Let's impute value for null values in workclass column for adults who have eductaion till 10th grade and are Never-married
adult_data[(adult_data['marital-status']=='Never-married') & (adult_data['education']=='10th')]
If you see row with index 106 is having workclass NaN and all other similar records with marital status as 'Never-married' and education as 10th are having workclass as 'Private'. So, we will impute workclass value as 'Privare' for null vaue records.
adult_data.loc[106, 'workclass'] = 'Private'
adult_data[(adult_data['marital-status']=='Never-married') & (adult_data['education']=='10th')]
# for simplicity, removing all rows with null values.
# You can drop rows if they are very less in comparision with total data you have
adult_data.dropna(axis=0, how='any', inplace=True)