Data cleaning is the process of identifying and correcting errors, inconsistencies, missing values, and duplicate records in raw data.
The goal is to improve data quality so the dataset is more accurate, complete, consistent, and suitable for analysis, reporting, machine learning, or other processing tasks.
Also known as: Data cleansing, data scrubbing.
Data cleaning focuses on fixing problems in raw data.
Data transformation focuses on converting data into a different format, structure, or representation.
In simple terms:
Both processes are commonly used in data preparation workflows.
Data validation checks whether data follows predefined rules or requirements.
Data cleaning takes action to correct or remove problematic records.
For example, validation may identify an invalid email address, while cleaning may correct the format or remove the record.
Typical data cleaning steps include:
The exact cleaning process depends on the dataset and how the information will be used.
Raw web data often contains inconsistencies that need to be cleaned before analysis.
Common issues include:
A typical web data pipeline may therefore include scraping, parsing, cleaning, validation, and storage.
Suppose a web application stores the following user activity records:
1. Name: John Doe, Login Time: 2026-01-05 12:00, Email: [email protected]
2. Name: Jane, Login Time: NULL, Email: [email protected]
3. Name: NULL, Login Time: 2026-01-05 13:30, Email: invalid-email
4. Name: John Doe, Login Time: 2026-01-05 12:00, Email: [email protected]
The dataset contains missing values, an invalid email, and a duplicate record.
A cleaning process may:
After cleaning, the dataset becomes more reliable for reporting and analysis.