Module 3: Data Cleaning and Preparation (Ages 13+)
๐ What Will You Learn?
By the end of this module, you will be able to:
- Explain why data is often messy โ and why cleaning it matters.
- Spot common data problems like missing values, duplicates, and typos.
- Fix simple data problems in a spreadsheet.
- Decide what to do when data is missing or wrong.
- Understand why cleaning data is one of the most important steps in analytics.
๐ง Lesson 1: Why Is Data Messy?
Here's a surprise: real data is almost always messy. People make typos,
skip questions, enter things twice, or write the same thing in different ways.
๐ณ Think of it like cooking: Before you can cook a meal, you have to wash
the vegetables, remove the bad parts, and chop everything up. Data cleaning is the same โ
you're preparing your ingredients before you "cook" (analyze) them.
Real-Life Messy Data Examples
- ๐ A survey where one person wrote their age as "13", another wrote "thirteen", and another wrote "13 years".
- ๐ A class list where "Sara" is spelled "Sarah" on one page and "Sara" on another.
- ๐ฑ A form where some people skipped the "favorite color" question.
- ๐ A sports app that lists a player's height as "5'9"" in one place and "175 cm" in another.
๐ก Key Idea: If you analyze messy data, you'll get messy (and wrong!) answers.
Cleaning comes before analysis โ always.
๐ Lesson 2: The Four Common Data Problems
Most messy data has one of these four problems. Learn to spot them!
1. Missing Values ๐ณ๏ธ
Some cells are empty. Maybe someone skipped a question, or the data got lost.
Example:
| Name | Age | Favorite Sport |
| Alex | 13 | Basketball |
| Jordan | โ | Soccer |
| Sam | 12 | โ |
2. Duplicates ๐ฏ
The same entry appears more than once. This can happen if someone clicks "submit" twice.
Example:
| Name | Age | Favorite Sport |
| Alex | 13 | Basketball |
| Alex | 13 | Basketball |
| Sam | 12 | Soccer |
3. Typos and Inconsistent Spelling โ๏ธ
The same thing is written in different ways.
Example:
| Name | Favorite Sport |
| Alex | soccer |
| Jordan | Soccer |
| Sam | SOCCER |
| Riley | socer |
These all mean the same thing โ but a computer sees them as four different sports!
4. Outliers ๐ฏ
A value that's way off from the rest. It might be a real number, or it might be a mistake.
Example: A class of 13-year-olds where someone wrote their age as 113 โ probably a typo!
๐ก Key Idea: Most data problems fall into these four categories. Once you know
what to look for, spotting them becomes easy!
๐ ๏ธ Lesson 3: How to Fix Data Problems
Here's what you can do about each problem:
| Problem |
What You Can Do |
Example |
| Missing values |
Leave it blank, fill it in if you know the answer, or remove the whole row |
If someone skipped "favorite color," you can't guess โ so mark it as "unknown" |
| Duplicates |
Delete the extra copies |
Remove the second "Alex" row if it's identical |
| Typos / inconsistent spelling |
Pick one spelling and use it everywhere |
Change "socer", "SOCCER", and "Soccer" all to "Soccer" |
| Outliers |
Double-check the value โ is it real or a mistake? |
An age of 113 for a 13-year-old is probably a typo for 13 |
โ ๏ธ Important: Never make up data just to fill a gap. If you don't know,
it's better to mark it as "missing" than to guess. Honesty matters in data analysis!
๐งน Think of it like cleaning your room: You don't throw away everything โ you
sort what you have, throw out the trash, and put things where they belong. Data cleaning works
the same way: sort, fix, and organize!
๐ป Lesson 4: Cleaning Data in a Spreadsheet
Spreadsheets have tools that make cleaning easier. Here are the ones you'll use most:
๐ Find and Replace
Use it to fix typos fast. For example, replace all "socer" with "Soccer" in one click.
๐ Sort
Sort a column AโZ to group similar values together. Duplicates and typos become easy to spot!
๐จ Filter
Filter a column to show only blank cells โ that's how you find missing values quickly.
๐งฎ Remove Duplicates
Most spreadsheets have a "Remove Duplicates" button that cleans repeated rows automatically.
๐ก Pro Tip: Always make a copy of your data before cleaning it.
That way, if you make a mistake, you still have the original!
๐ธ Think of it like a photo: Always keep the original photo before you start
editing it. If you mess up, you can always go back to the original!
๐ฏ Fun Activity: Clean the Messy Class List
Your Mission: Clean up this messy class survey data!
Copy this table into a spreadsheet:
| Name | Age | Favorite Subject |
| Alex | 13 | math |
| Jordan | โ | Science |
| Sam | 12 | Math |
| Alex | 13 | math |
| Riley | 113 | sciense |
| Sam | 12 | English |
| Taylor | 13 | โ |
| Jordan | 12 | science |
| Sam | 12 | Math |
Your tasks:
- Find and remove any duplicate rows.
- Find any missing values and decide what to do with them.
- Fix any typos in the "Favorite Subject" column (make them all the same).
- Find any outliers and think about whether they're mistakes.
- Write down what you changed and why.
Submit: Your cleaned spreadsheet + a short list of every change you made and your reason for it.
๐ Quick Quiz
- Why is it important to clean data before analyzing it?
- Name the four common data problems we learned about.
- What should you do if a value is missing and you can't figure out the real answer?
- Why is "soccer" different from "Soccer" to a computer?
- Name one spreadsheet tool that helps clean data.
- Why should you always make a copy of your data before cleaning it?
๐ Key Words to Remember
- Data cleaning โ fixing or removing messy, wrong, or incomplete data.
- Missing value โ an empty cell where data should be.
- Duplicate โ a row that appears more than once.
- Outlier โ a value that's very different from the rest.
- Inconsistent data โ the same thing written in different ways.
- Raw data โ the original, uncleaned data you start with.
- Clean data โ data that's ready to analyze.
- Find and Replace โ a spreadsheet tool for fixing typos quickly.
- Remove Duplicates โ a spreadsheet tool for deleting repeated rows.
๐ Want to Learn More?
- Ask a parent or teacher to help you download a free dataset and try cleaning it yourself.
- Try the free "Data Cleaning" lesson on Kaggle Learn.
- Practice with a family member's old spreadsheet (with permission!).
- Look at a messy list of anything โ your music playlist, your contacts, your game stats โ and see how you'd clean it up.
๐ Big Idea: Cleaning data is like tidying your room โ it takes time, but once
it's done, you can actually find what you need and get things done!