Welcome to Module 5!
Imagine your school has a spreadsheet containing the names, ages, phone numbers and examination scores of 500 students. However, some names are spelt incorrectly, some students appear twice, and some records have missing information.
Can you analyse this information and expect to get correct results?
Probably not!
Before analysing data, you must make sure the information is accurate, complete and properly organised. This process is called Data Cleaning.
In this module, you will learn how to identify mistakes, remove duplicate records, correct errors and prepare information for analysis using simple examples.
Data cleaning is the process of finding and correcting errors, removing unnecessary information and improving the quality of a dataset.
Think about cleaning your bedroom. Before arranging your books and clothes, you may need to remove rubbish, put misplaced items in the right places and organise everything properly.
Data cleaning works in a similar way. It helps you organise information so that it can be used correctly.
Examples of data problems include:
A data analyst must identify these problems before using the information to make decisions.
Imagine a supermarket wants to know how many bottles of water it sold last month. Unfortunately, some sales records were entered twice.
If the supermarket uses these incorrect records, it may believe it sold more bottles than it actually did.
This could lead to poor business decisions.
Data cleaning is important because it helps to:
Missing information happens when some details that should be included in a dataset are not available.
For example, a school may have a spreadsheet containing students' names, ages and examination scores. However, some students may not have examination scores recorded.
Example of a dataset with missing information:
| Student Name | Age | Examination Score |
|---|---|---|
| John | 13 | 75 |
| Mary | 12 | |
| David | 14 | 65 |
| Sarah | 90 | |
| Peter | 13 | 80 |
Can you identify the problem?
There are different ways to handle missing information, depending on the situation.
Important: Never invent information just to fill an empty space. An incorrect value can make your analysis unreliable.
A duplicate record is information that appears more than once when it should only appear once.
Imagine a school accidentally records the same student twice in its database.
Example:
| Student ID | Student Name | Class |
|---|---|---|
| ST001 | John | JSS 2 |
| ST002 | Mary | JSS 2 |
| ST003 | David | JSS 2 |
| ST002 | Mary | JSS 2 |
| ST004 | Sarah | JSS 2 |
The record for Mary appears twice with the same student ID. This is a duplicate record.
Before removing duplicates, make a backup copy of your data. Also, check whether records are truly duplicates. Two different people may have the same name but different student IDs.
Sometimes, information is entered incorrectly because of typing mistakes or inconsistent formatting.
For example, a business may record the name of the same town in different ways.
Example:
| Original Entries | Corrected Entry |
|---|---|
| Ibadan | Ibadan |
| ibadan | Ibadan |
| IBADAN | Ibadan |
| Ibadn | Ibadan |
Although these entries may refer to the same location, they are written differently.
If you are counting the number of customers from Ibadan, these differences may cause problems when grouping the information.
Consistent formatting makes information easier to search, compare and analyse.
Inconsistent data means information that follows different formats or rules even though it should be organised in the same way.
Imagine a business records its customers' phone numbers like this:
These entries may represent phone numbers written in different formats.
A data analyst may need to standardise the format so that all records follow the same pattern.
For example, you may decide that all dates in a school attendance spreadsheet should use the format DD/MM/YYYY.
Now let's put what you have learned into practice.
Imagine you work as an assistant in a school office. Your teacher gives you the following student records and asks you to clean the information.
Original Student Records:
| Student ID | Student Name | Age | Class | Score |
|---|---|---|---|---|
| ST001 | John | 13 | JSS 2 | 75 |
| ST002 | MARY | 12 | JSS 2 | 85 |
| ST003 | David | 14 | JSS 2 | 65 |
| ST002 | Mary | 12 | JSS 2 | 85 |
| ST004 | Sarah | JSS 2 | 90 | |
| ST005 | Peter | 13 | JSS 2 | 80 |
Identify the problems:
Your cleaning tasks:
Your goal is to produce a dataset that is accurate, organised and ready for analysis.
In this module, you have learned that:
Imagine you are helping a small supermarket organise its customer records. You discover the following information:
| Customer ID | Customer Name | Location | Phone Number |
|---|---|---|---|
| C001 | John | Ibadan | 08012345678 |
| C002 | MARY | ibadan | 08023456789 |
| C003 | David | Lagos | |
| C002 | Mary | Ibadan | 08023456789 |
| C004 | Sarah | Abuja | 08034567890 |
Your tasks:
Answer these questions to test your understanding.
You have successfully completed Module 5: Cleaning and Preparing Data.
You now understand how to identify missing information, remove duplicate records, correct mistakes and organise information properly.
Remember, good analysis starts with good data!
In the next module, you will discover how to present information using charts, graphs and data visualisation. You will learn how to turn numbers into pictures that make information easier to understand.