Skip to content
Maestro

Clean Your Data Without Breaking It

By the end, you'll be able to clean a work table in pandas or in SQL without losing rows that matter, and explain every change you made.

You go at your own pace, with your Maestro beside you, 1:1, through the whole course: ask it anything, and it asks you questions too.

13 skills · 5 modules

What you'll be able to do

Each box is a skill. The base is at the bottom, recognizing and explaining, and you work your way up to building something of your own and judging what works and why.

  1. Synthesize

    • Write a cleaning script you can rerun on a new file that logs every step with its row counts

      Where I teach it: A script you can run again · How do I turn my cleaning into a script I can run again?

      Builds on:

      • Decide whether a blank means zero, unknown or not applicable, and who confirms it
      • Normalize text categories in pandas with strip, lower and an explicit map
      • Flag the values that break a confirmed rule instead of deleting them
      • Count rows before and after every step to catch the ones that vanish without warning
      • Decide which copy of a repeated record stays, and keep it by sorting before you drop

      Your Maestro asks you to build something of your own with it and saves it as evidence when you do.

  2. Analyze

    • Decide whether a blank means zero, unknown or not applicable, and who confirms it

      Where I teach it: Look before you change anything · What does an empty cell mean? Zero, "unknown" or "not applicable"

      Builds on:

      • Make an inventory of a table's problems before changing it

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Choose the columns that make two rows the same record and predict how many rows remain

      Where I teach it: Duplicates: real and fake · Why doesn't drop_duplicates() remove my repeats? Define the key first

      Builds on:

      • Count rows before and after every step to catch the ones that vanish without warning

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Decide which copy of a repeated record stays, and keep it by sorting before you drop

      Where I teach it: Duplicates: real and fake · How do I keep the latest entry for each folio in pandas?

      Builds on:

      • Choose the columns that make two rows the same record and predict how many rows remain

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Compare DISTINCT with ROW_NUMBER for removing repeats in SQL, and write the query the key calls for

      Where I teach it: Now do it in SQL · Why doesn't DISTINCT remove my duplicates? ROW_NUMBER and QUALIFY in DuckDB

      Builds on:

      • Choose the columns that make two rows the same record and predict how many rows remain
      • Clean text, numbers and blanks in SQL with TRIM, LOWER, CASE, REPLACE, TRY_CAST and COALESCE

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

  3. Apply

    • Make an inventory of a table's problems before changing it

      Where I teach it: Look before you change anything · What should I check in a table before cleaning it? Build a problem inventory

      Builds on:

      • Describe a cleaning method: look, decide with the person who knows the data, fix in code, count rows and write it down
      • Explain why one value written in several ways counts as different categories

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Normalize text categories in pandas with strip, lower and an explicit map

      Where I teach it: Fix it in code, not by hand · How do I clean text written many different ways in pandas? strip, lower and a map

      Builds on:

      • Explain why one value written in several ways counts as different categories
      • Make an inventory of a table's problems before changing it

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Convert numbers stored as text and count the values that could not be converted

      Where I teach it: Fix it in code, not by hand · Why won't pandas add up my amounts? Numbers stored as text

      Builds on:

      • Make an inventory of a table's problems before changing it

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Flag the values that break a confirmed rule instead of deleting them

      Where I teach it: Fix it in code, not by hand · Should I delete or flag an impossible value? How to find it in pandas

      Builds on:

      • Convert numbers stored as text and count the values that could not be converted

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Count rows before and after every step to catch the ones that vanish without warning

      Where I teach it: Fix it in code, not by hand · How do I know if my cleaning lost rows? Count before and after every step

      Builds on:

      • Describe a cleaning method: look, decide with the person who knows the data, fix in code, count rows and write it down

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Clean text, numbers and blanks in SQL with TRIM, LOWER, CASE, REPLACE, TRY_CAST and COALESCE

      Where I teach it: Now do it in SQL · How do I clean text, numbers and blanks in SQL? TRIM, CASE, TRY_CAST and COALESCE

      Builds on:

      • Normalize text categories in pandas with strip, lower and an explicit map
      • Convert numbers stored as text and count the values that could not be converted

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

  4. Understand

    • Explain why one value written in several ways counts as different categories

      Where I teach it: Look before you change anything · Why does pandas count "CDMX" and "cdmx " as different cities?

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

    • Describe a cleaning method: look, decide with the person who knows the data, fix in code, count rows and write it down

      Where I teach it: Look before you change anything · Why does pandas count "CDMX" and "cdmx " as different cities?

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

What we'll cover

  1. Look before you change anything

    1. Why does pandas count "CDMX" and "cdmx " as different cities?
    2. What should I check in a table before cleaning it? Build a problem inventory
    3. What does an empty cell mean? Zero, "unknown" or "not applicable"
  2. Fix it in code, not by hand

    1. How do I clean text written many different ways in pandas? strip, lower and a map
    2. Why won't pandas add up my amounts? Numbers stored as text
    3. Should I delete or flag an impossible value? How to find it in pandas
    4. How do I know if my cleaning lost rows? Count before and after every step
  3. Duplicates: real and fake

    1. Why doesn't drop_duplicates() remove my repeats? Define the key first
    2. How do I keep the latest entry for each folio in pandas?
  4. Now do it in SQL

    1. How do I clean text, numbers and blanks in SQL? TRIM, CASE, TRY_CAST and COALESCE
    2. Why doesn't DISTINCT remove my duplicates? ROW_NUMBER and QUALIFY in DuckDB
  5. A script you can run again

    1. How do I turn my cleaning into a script I can run again?
    2. Can you clean data without losing rows? Check yourself and pick what's next

Common questions

What do I need to know before I start?
You should have opened a table in pandas or written a SELECT with a WHERE at least once. Every line of code in the course is explained, and your Maestro helps if something is unclear. If you have never used either one, the course still teaches you the method, which works in Excel too.
Is it free? Do I need an account?
It's free. You can read every page without an account. With a free account you enroll with one tap, run the code on each page and ask your Maestro questions.
Do I have to install anything?
No. The Python and SQL code runs inside Maestro: you type on the page and see the result below it. You can download the project from the last module and run it on your own computer whenever you like.
Is the data real?
No. The coffee cooperative's sales and members are synthetic data, made up for the course, with the problems that show up in real work tables.
My file shows broken accents or everything in one column. Will this help?
That's a problem with how the file is read, not with cleaning, and this course doesn't cover it: it starts once the table has opened correctly. Dates aren't covered here either.

What you get

  • 5 modules and 13 pages, open whenever you want them.
  • Open to everyone: read all of it, and your Maestro, an AI, answers one question per page, on up to five pages a day.

  • With a free account: your Maestro for the whole course, always on the page you're on, and the exercises run with nothing to install.

Words you'll meet

In the lessons, tap one to see what it means, or ask your Maestro about it.

Who's teaching you

Sergio Sánchez

I'm Sergio, chekos online. I've worked with data for about ten years, mostly at mission-driven organizations: policy research first, then education, and now early childhood services. In 2018 I started tacosdedatos to share what I was learning, and since then it's been a blog, a podcast, courses, guides, and a community. These days I spend a lot of my time building with AI agents and writing about how I organize my work around them. I share what I've learned; you take what's useful and make it yours.

See you in the course

Clean Your Data Without Breaking It