WeCodeAcademy

Handling Missing Data

Missing values appear as NaN. isna() marks them, fillna(value) replaces them and dropna() removes the rows that have them. Always decide on purpose: dropping loses rows, filling invents numbers.

Examplepython
Open in editor »
Quick check

What does `dropna()` do?

Your turn: write the code

Print how many scores are missing (use isna().sum()).

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.