This missing-value counter uses == float("nan") — which matches NOTHING, so it reports zero missing. Fix the check so it prints missing: 2.
The break is on line 5 — but read the whole snippet first.
This missing-value counter uses == float("nan") — which matches NOTHING, so it reports zero missing. Fix the check so it prints missing: 2.