Data Cleaning Exercises

Module 20 · Job-ready delivery · 6 min

Explain a trade-off

You'll be able to: Present a cleaning choice as options with their effect on the numbers and a recommendation.

Before this: Hand off a cleaning job: rules, exceptions, reconciliation

The idea

Many cleaning choices have no single right answer: quarantine strictly or accept with a flag; merge on email or wait for review.

Explain each option in one line, show how it changes the key numbers, and recommend one with your reason.

Let the owner decide when the choice changes business meaning.

Worked example

Input: strict ranges reject 15% of rows

Visual
(document) Option A strict · Option B flag · impact on totals
SQL (DuckDB)
SELECT reason, COUNT(*), SUM(amount) FROM exceptions GROUP BY ALL
pandas
exceptions.groupby("reason")["amount"].agg(["count", "sum"])

Result: Strict: revenue −4.1%; flag: unchanged revenue, 15% rows marked

Common mistakes

  • Presenting one option as the only one.
  • No numbers.
  • Deciding business meaning alone.

Check yourself

What three things does a good trade-off explanation include?

Options, their impact on the numbers, and a recommendation.

Practice it

Validate quantities and prices against ranges.

Next: Validate quantities and prices against ranges