Diagnose and handle missing data with pandas

8 steps · about 3 h 45 min · Intermediate

  1. Recognise pandas missing-value representations (guide, pandas documentation, 40 min)

    Different dtypes represent absence differently, which affects comparisons, arithmetic and conversion.

  2. Map missingness by row and column (reference, pandas documentation, 20 min)

    A Boolean mask is the basis for counts, rates and patterns of absent values.

  3. Compare simple and multivariate imputation (guide, scikit-learn developers, 40 min)

    Learn what each method assumes before replacing values that were never observed.

  4. Delete incomplete records deliberately (reference, pandas documentation, 20 min)

    Control axes and thresholds so deletion follows a documented rule rather than convenience.

  5. Fill values with an explicit mapping (reference, pandas documentation, 20 min)

    Column-specific values avoid applying one meaningless replacement across unlike variables.

  6. Measure imputation effects on a model (guide, scikit-learn developers, 35 min)

    Compare strategies through downstream validation rather than assuming the most complex method wins.

  7. Preserve a missingness signal (guide, scikit-learn developers, 20 min)

    An indicator can capture information in the fact that a measurement was absent.

  8. Fit imputation inside the validation pipeline (guide, scikit-learn developers, 30 min)

    Learning replacement values from the full dataset leaks information into evaluation.