Data cleaning, profiling, and preparation are the steps you take to turn messy, raw data into a clean, trustworthy dataset that you can analyse. Without these steps, any report or chart you produce will be built on a shaky foundation, leading to wrong conclusions. For the DA0-002 exam, mastering this process is critical because the test will ask you to identify dirty data, choose the right cleaning method, and explain why preparation matters in real-world scenarios.
Jump to a section
A simple way to picture Data Cleaning, Profiling, and Preparation
A restaurant kitchen can't serve good food if the ingredients are delivered in a mess. First, a pile of raw vegetables arrives from the supplier, and that leads to the kitchen staff needing to sort through everything before any cooking begins. They cannot just toss the onions, potatoes, and carrots into the pot without first inspecting each one. Some potatoes have dirt and sprouts, which need to be cut away. A few onions are bruised and would ruin the flavour of a whole stew, so they get thrown out. The chef also checks the order: the delivery slip says 'five kilos of potatoes', but the scale shows only four and a half. That is a data profiling task — examining the quality and quantity of the ingredients as they arrive. Then the sous-chef rinses the carrots, peels the potatoes, and dices the onions into uniform pieces. That is data cleaning: removing the unwanted bits and standardising the shape so everything cooks evenly. Finally, the prepped vegetables are portioned into labelled containers and arranged on the shelf in the order they'll be used. That is data preparation — organising the clean data into a ready-to-use structure. If the kitchen skipped this step, a customer's soup might contain a rotten onion, or the portion sizes would be wrong, and the restaurant would get bad reviews. Similarly, a data analyst who skips cleaning, profiling, and preparation will produce unreliable reports and bad business decisions.
Data cleaning, profiling, and preparation are the three phases you go through before you can actually analyse data. Think of them as the 'wash, sort, and chop' of data work. Let's break down each one from the ground up.
Data profiling is the discovery phase. Before you clean anything, you need to understand what you're working with. Profiling means examining a dataset to find its structure, content, and quality. You look at things like: what columns exist, what data types are in each column (numbers, text, dates), how many rows there are, and whether values are missing. For example, if you have a spreadsheet of customer orders, profiling would tell you that the 'Order Date' column contains dates, but some cells have text like 'last week' instead of a proper date. Profiling also reveals patterns, like a column that should have male or female values but contains 'M', 'Male', 'F', 'Female', and even 'f' — this is called inconsistent formatting. The goal of profiling is to create a 'profile report' that lists every issue you need to fix.
Data cleaning is the repair phase. Once you know what's wrong, you fix it. Cleaning involves correcting errors, removing duplicates, handling missing data, and standardising formats. Common cleaning tasks include: - Handling missing values: You might remove rows with missing data (called deletion), fill them with an average value (imputation), or mark them as 'unknown'. - Removing duplicates: If the same customer appears twice, you delete one copy. - Fixing typos and inconsistencies: Changing 'N/A' to 'Null' or 'Male' to 'M' so everything matches. - Outlier treatment: Identifying values that are far outside the normal range, like an age of 450 in a column of human ages, and deciding whether to delete them or investigate. - Validating data: Checking that dates are real dates, phone numbers have the right number of digits, and email addresses contain an '@' symbol.
Data preparation is the arrangement phase. After cleaning, the data is clean but often not in the right shape for analysis. Preparation means transforming the data into a format that analysis tools can use. This includes: - Reshaping data: Changing data from a 'wide' format (many columns) to a 'long' format (few columns but more rows) or vice versa. - Merging datasets: Combining data from two or more sources, like joining a customer list with a sales list. - Creating new calculated fields: For example, adding a 'Profit' column that subtracts Cost from Revenue. - Sorting and filtering: Organising data so you can focus on the relevant parts. - Splitting columns: If a column contains full names, you might split it into 'First Name' and 'Last Name'.
Why does this whole process exist? Before computers, data was recorded on paper forms, and errors were corrected by hand. Today, data comes from many automated sources like website forms, sensors, and databases, and each source can introduce errors: humans mistype their names, sensors glitch, and systems store dates in different formats. If you skip cleaning and profiling, your analysis will be 'garbage in, garbage out' — no amount of fancy charts can fix bad underlying data.
What does it replace? In the past, a single data entry clerk might have checked data manually. Now, with millions of rows, we use software like Excel, OpenRefine, or Python libraries (like pandas) to automate much of the profiling and cleaning. The exam focuses on understanding the concepts and knowing which technique to apply in which situation, not on writing code.
Profiling the Data
Examine the raw dataset to understand its structure: count rows and columns, note data types (numbers, text, dates), and identify missing values, duplicates, and inconsistent formats. This step builds a 'profile report' that guides all subsequent cleaning.
Handling Missing Values
Decide how to treat missing data. Options include deleting rows (listwise deletion), replacing with a calculated value like the mean or median (imputation), or leaving the field blank. The choice depends on how much data is missing and the importance of that field to your analysis.
Standardising Formats
Fix inconsistencies in how data is recorded, such as dates in different formats (MM/DD/YYYY vs DD/MM/YYYY) or names with varied capitalisation. Convert all entries to a single, uniform format to ensure accuracy in reports and sorting.
Removing Duplicate Records
Identify and delete rows that are exact duplicates of each other. Use a 'Remove Duplicates' tool or deduplication function, but only if the duplicates truly represent the same event or entity. Keep duplicates that are legitimate repeated entries (e.g., multiple purchases by the same customer).
Transforming and Reshaping the Data
Prepare the clean data for analysis by merging multiple tables on a common key, splitting columns (e.g., full name into first and last), creating new calculated fields, and sorting or filtering rows. This step produces a final dataset ready for visualisation or statistical analysis.
Let's walk through a realistic scenario at a mid-sized retail company called 'ShopSmart'. The marketing team wants to send a promotional email to all customers who have made a purchase in the last six months. They ask you, the data analyst, to prepare the list. Here is what you actually do step by step.
First, you receive a raw export from the company's sales database. The file is a CSV (comma-separated values) with columns like CustomerName, Email, PurchaseDate, TotalAmount, and City. You open it in a spreadsheet tool. This is where profiling begins.
You start by checking the total number of rows. There are 12,000 rows, but you notice some rows are completely blank. That's a red flag. You use a pivot table or a profiling function to count how many emails are missing. The result: 450 rows have no email address. You also spot that the Email column contains duplicates: some customers appear twice because they bought items on separate days, and the system created a new record each time.
Now you move to cleaning. You have to decide what to do with the 450 missing emails. Because you need an email to send the promotion, you decide to delete those rows entirely (deletion by listwise). Next, you handle duplicates. You use a 'Remove Duplicates' tool, which keeps only the most recent purchase for each customer. After deletion, you have 10,200 unique customers. But then you check the City column and find that 'New York' is written as 'NY', 'New York City', and 'NYC'. You standardise all of them to 'New York' using a find-and-replace function.
Finally, preparation. The marketing team wants the list sorted alphabetically by last name. Your data has a 'CustomerName' column with full names like 'John Smith'. You split this into two new columns: 'FirstName' and 'LastName'. Then you sort the entire table by LastName. You also create a new column called 'Segment' that categorises customers based on their TotalAmount: 'High Spender' if over £500, 'Medium' if between £100 and £500, and 'Low' if under £100. This is a calculated field.
The final step is to save the cleaned and prepared data as a new CSV file, which you send to the marketing team. They import it into their email tool. Because you cleaned and prepared it, every email address is valid, nobody gets duplicate emails, and the team can easily target high spenders. If you had skipped these steps, the marketing team might have sent 450 emails to blank addresses (bouncing), annoyed customers with duplicate messages, and been unable to segment their audience.
The DA0-002 exam tests data cleaning, profiling, and preparation heavily. Expect around 10 to 15 questions on this objective alone. The questions are scenario-based: you'll be given a description of a messy dataset and asked to choose the correct cleaning or profiling step.
What they love to test: - The difference between data profiling and data cleaning. Profiling is about discovering issues (finding missing values), cleaning is about fixing them (deleting the rows). A classic trap: they describe a situation where someone is 'reviewing the data to find errors', which is profiling, not cleaning. - Handling missing data. They will ask: if you have missing values in a field that is critical for analysis, should you delete the row, replace with an average, or leave it blank? The correct answer usually depends on the context, but they often prefer deletion if the missing data is small (<5% of rows) and imputation if the field is numeric. - Standardisation vs transformation. A question might give you a column with 'Jan', 'January', '01', and ask what step to take. The answer is standardisation (making all values consistent), not removing duplicates. - Outlier detection methods. They might ask which statistical method identifies outliers. Look for terms like 'z-score' (a measure of how many standard deviations a value is from the mean), 'IQR' (interquartile range, the range between the 25th and 75th percentiles, often used to flag values outside 1.5 times the IQR). - Data preparation techniques like merging and concatenation. A scenario where you have two tables with customer IDs: one with addresses, one with purchase history. The correct action is to merge on the common ID.
Common traps: - They will present a scenario where a column has 'M', 'Male', 'F', 'Female' and ask if this is a duplicate issue. It's an inconsistency issue, not a duplicate. Duplicates mean the same row appears twice, not inconsistent values. - They might say 'remove all blank rows' without considering context. If the blank rows are in a non-essential field, you might keep them. The exam tests your ability to decide based on the analysis goal. - They often mix up 'denormalisation' (adding redundant data to speed up queries) with 'normalisation' (reducing redundancy). Be clear: denormalisation is a preparation step that improves performance.
Key definitions to memorise: - Data profiling: The process of examining data to understand its structure, content, and quality. - Data cleaning: The process of correcting or removing inaccurate, incomplete, or irrelevant data. - Data preparation: The process of transforming clean data into a format suitable for analysis. - Imputation: Replacing missing values with substitutes like the mean, median, or mode. - Outlier: A value that lies significantly outside the normal range of other values in a dataset.
Data profiling discovers what is in your data, data cleaning fixes errors, and data preparation reshapes data for analysis.
Missing data can be handled by deletion, imputation with mean/median/mode, or leaving it null; the choice depends on the analysis goal.
Inconsistent formatting, like mixing 'Jan' and 'January', is an error that standardisation fixes, not a duplicate problem.
Outliers should be investigated, not automatically removed, because they could represent fraud or rare valuable events.
Data preparation includes merging datasets, splitting columns, sorting, filtering, and creating calculated fields.
The 'Remove Duplicates' function should be used only when duplicate rows are exact copies of the same event, not for legitimate repeated entries.
Data profiling is the first step in the workflow, and skipping it leads to poor cleaning decisions.
These come up on the exam all the time. Here's how to tell them apart.
Data Profiling
Focuses on discovering issues like missing values and inconsistencies
Produces a report summarising data quality, not a fixed dataset
Performed at the very beginning of the workflow
Data Cleaning
Focuses on correcting the issues discovered in profiling
Produces a cleaned dataset with errors removed or fixed
Performed after profiling is complete
Imputation
Replaces missing values with a statistical estimate (mean, median, mode)
Preserves the number of rows in the dataset
Useful when missing data is random and you want to retain sample size
Deletion
Removes entire rows or columns with missing values
Reduces the number of rows, potentially losing information
Preferred when missing data is small and not critical to analysis
Outlier Detection (Z-Score)
Uses standard deviation to identify outliers (values above 3 or below -3)
Assumes data is normally distributed
Works well for symmetric distributions
Outlier Detection (IQR)
Uses quartiles (Q1 and Q3) to identify outliers (values beyond 1.5*IQR)
Does not assume any specific distribution
Works well for skewed distributions
Standardisation
Makes all values consistent in format (e.g., all dates in YYYY-MM-DD)
Does not change the meaning of data
Applied to categorical or text columns
Transformation
Changes the structure or scale of data (e.g., merging tables, creating new columns)
Often changes the meaning or representation of data
Applied to numerical or relational data for analysis
Mistake
Data cleaning and data preparation are the same thing.
Correct
Data cleaning corrects errors and removes bad data; data preparation transforms the clean data into a useful format (like merging tables or creating new columns). They are sequential but distinct steps.
The terms are often used interchangeably in casual conversation, but the exam distinguishes them clearly.
Mistake
Removing duplicates is always the best action to take.
Correct
Duplicates sometimes carry meaningful information, like a customer making two separate purchases. You should remove duplicates only when they are exact duplicates of the same event, not when they are legitimate repeated occurrences.
Beginners think 'unique' is always better, but real-world data often has repeated events that should stay.
Mistake
If data is missing, you should replace it with the average value every time.
Correct
Imputation with the average is one option, but it can skew results if the data is not normally distributed. For categorical data, the mode (most common value) is better, and sometimes deletion is more appropriate.
This mistake happens because many online tutorials teach 'fill with mean' as a catch-all, without explaining the assumptions.
Mistake
Data profiling is only about finding errors.
Correct
Profiling also discovers the data's structure, like the number of rows, data types, and relationships between columns. Error detection is just one part of profiling.
Beginners focus on 'finding mistakes' because that's the intuitive part, but profiling includes basic metadata gathering.
Mistake
Outliers should always be removed from a dataset.
Correct
Outliers may be critical information, like fraud detection or rare events. You should investigate outliers before removing them, and only remove them if they are due to errors or irrelevant to the analysis.
People are taught that outliers 'break' statistics, but in fields like finance or security, outliers are the most important data points.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Data cleaning fixes errors like missing values or typos; data preparation reshapes and organises the cleaned data into a format suitable for analysis, such as merging tables or adding calculated columns.
No. Only delete rows if the missing data is small (under 5% of total) and the field is critical. Otherwise, consider imputation or leaving the data null, as deletion can reduce your sample size and bias results.
Outliers are detected using methods like z-scores (values more than 3 standard deviations from the mean) or the interquartile range (IQR) method (values below Q1 - 1.5*IQR or above Q3 + 1.5*IQR).
Standardisation means converting all values in a field to a consistent format, such as changing 'M', 'Male', 'male' to just 'Male', or converting all dates to YYYY-MM-DD.
No. Data profiling reveals hidden issues like duplicates, nulls, or outliers that are not visible at a glance. Always profile first to avoid making bad assumptions.
Imputation is replacing missing values with substitutes like the mean, median, or mode. Use it when you have enough data to calculate a representative value and the missingness is random, not systematic.
You've finished Data Cleaning, Profiling, and Preparation. Continue through the DA0-002 study guide to build a complete picture of the exam.
Done with this chapter?