Skip to content
Justice Tech School

Find Missing Values

Missing numbers appear as NaN and missing text as NA. isna marks them and sum counts them per column.

Example
import pandas as pd
import numpy as np
df2 = pd.DataFrame({'a': [1, np.nan, 3], 'b': ['x', None, 'z']})
print(df2.isna())
print(df2.isna().sum().to_dict())

Result

       a      b
0  False  False
1   True   True
2  False  False
{'a': 1, 'b': 1}

Exercise

Count missing per column.

df.isna().()

Quiz Test

What does isna return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.