Data cleaning
- Nivetha R
- Sep 2
- 4 min read
Data cleaning is the process of fixing incorrect, incomplete or duplicate data in a data set.
It involves identifying data errors and then changing, updating or removing data to correct them. Data cleaning also known as data cleansing or data scrubbing.
Data scrubbing is a subset of data cleansing that involves removing duplicate, bad, unneeded or old data from data sets.
Similarly, data cleaning is another subset of data cleansing that focuses on correcting errors and inconsistencies in the data set.
Importance of Data Cleaning
Data cleaning is important because wrong or missing information can cause mistakes in your results. Clean data helps you get correct answers, make good decisions, and avoid problems. If data is not cleaned, it can lead to confusion and missed chances.

Steps of Data Cleaning:
Removing Duplicate
Duplicate rows are a common problem in data and can make your results wrong. These rows have the same values in every column and usually happen because of repeated entries, system mistakes, or combining data from different places. If we keep duplicates, we might count things more than once or get wrong answers. To fix this, look for rows that are exactly the same and remove the extra ones. Sometimes, we also need to check for partial duplicates (like the same name written in different ways) and clean them.
Fixing Structural Errors
These are mistakes in how the data is entered, like spelling errors, using different names for the same thing, or not following the same format. For example, "NY" and "New York" might both be used for the same place. Dates might be written in different ways like "01/09/2025" and "2025-09-01". Fixing these errors helps keep the data clear, consistent, and easier to work with.
Handle Missing Values
Data input methods enable us to fill empty cells, unclassified categories, and missing entries wherever possible. We can fill missing values using methods like the average (mean), the most common value (mode), or by carrying forward previous data. In some cases, we need to remove rows with missing data if they can’t be filled in a meaningful way. Handling missing values properly is important to avoid errors and improve the quality of the analysis.
Filtering Outliers
Outliers are values that are much higher or lower than the rest of the data. Some outliers are real and happen naturally, like someone earning a very high salary. But others can be mistakes, like typing an extra zero or a broken sensor giving the wrong reading. It's important to check outliers carefully to see if they are valid or need to be removed, because they can affect the results and make the data less accurate.
Convert Data Types
Converting data types is important to make sure the data is able to read and used correctly. Wrong types can cause errors, slow things down, or give wrong results. For example, if numbers are stored as text, we can’t do calculations on them. Dates stored as plain text can’t be sorted or used in time-based analysis. Changing data to the correct type, like converting text to numbers or strings to dates, helps the tools and models work properly.
Remove Unnecessary or Duplicate Features
Unnecessary features can make the model confused, slow to learn, and less accurate. To avoid this, remove features that don’t change much or are very similar to others. These extra features add noise and don’t help the model understand the data better. By keeping only important features, the model can focus on what really matters and gives better results faster.
Validate Data Accuracy
Make sure the data is accurate and matches real-life facts by checking it against reliable sources. Also, use simple rules (like age must be greater than zero) to catch mistakes. We can look for values that don’t make sense or are out of normal ranges. Fixing these errors helps keep our data trustworthy and improves the results from it.
Keep Data Format Uniform
Make sure the data is uniform so it’s easier to combine and analyze, like standardize date formats, text case (e.g., lowercase), currency symbols, and more. Consistent formatting helps avoid confusion and mistakes when working with data. It also makes it simpler to compare and join different datasets. When everything looks the same, our analysis becomes faster and more accurate.
Document Cleaning Process
Document all cleaning steps clearly using comments and version control to ensure the work can be repeated and reviewed. Writing down what we did helps others understand the process and makes it easier to fix mistakes later. It also saves time if we need to do the same task again in the future. Good documentation makes the work more organized and professional.
Conclusion
Data cleaning is an important step before using data. It helps to fix mistakes, remove wrong or extra data, and make sure everything is correct. Clean data gives better results and helps to making the right decisions.
References: Data Cleaning, Data Analysis


