Understand the idea
isna flags missing cells True and present cells False. Missing means unknown or absent; it is different from zero.
A small example
For [5, missing, 0, missing], isna() is [False, True, False, True]: 2 gaps out of 4, or 50%.
Follow the code
Apply the idea to the supplied table. Read from top to bottom; the final line displays the result.
df.isna().sum()What each part does
df.isna()- True at missing cells
.sum()- add down each column
None / NaN- missing-value representations
Your inputs
The editable setup on the right creates df. Run executes the setup and your work from top to bottom.
| order | drink | size | price | tip | date |
|---|---|---|---|---|---|
| 101 | " latte " | LARGE | 6.20 | 1 | 2026-06-01 |
| 102 | TEA | small | 3.10 | 0.5 | 2026-06-02 |
| 103 | " mocha " | LARGE | oops | None | not a date |
| 104 | Latte | Small | None | 0.8 | 2026-06-04 |
| 104 | Latte | Small | None | 0.8 | 2026-06-04 |
| 105 | "tea " | SMALL | 4.20 | 0.6 | 2026-06-05 |
| 106 | ESPRESSO | small | 2.50 | 0.2 | 2026-06-06 |
| 107 | " mocha" | large | 6.80 | 1.5 | 2026-06-07 |
Your task · Follow
- Using df, return the number of missing values in every column.
- Use: isna().
Hint
isna makes the missing mask; sum counts True values down each column.
Reveal solution
One way to do it. Keep any supplied setup in the editor and use this in the Your work section.
df.isna().sum()