Textbook answers: 5-2 Data Cleaning and Transformation
Suggested answers by the site team, the book has no answer key.
Try 1
1What is the term for the processing that fills in the missing parts of data with values such as the mean or median?
Show answer
Imputation.
Imputation estimates a replacement for a missing cell, simply (mean or median) or with a more advanced method, after understanding why and how values are missing.
2What is the term for the processing that converts data to a range from 0 to 1?
Show answer
Normalization (Min–Max scaling).
Min–Max scaling makes the smallest value 0 and the largest 1, with every other value placed proportionally in between.
Note: Arabic edition: The Arabic edition uses more than one name for it (التحويل الكمي and تحجيم Min–Max); both are acceptable.
3What is the term for the processing that converts data to a form with mean 0 and standard deviation 1?
Show answer
Standardization.
It subtracts the mean from each value and divides by the standard deviation, so the result tells you how many standard deviations a value is from the mean.
4What is the term for the operation that connects multiple datasets via a common item?
Show answer
Join.
A join combines data from several tables using a key or matching condition, such as linking the student register to the marks sheet by student ID.
Try 2
(1)From the following options (A–D), choose the one that is NOT an appropriate response to missing values.
A - When there are few missing values and the impact on the whole is small, delete rows containing missing values.
B - When missing values are scattered randomly, fill in the missing parts with values such as the mean.
C - When the missingness itself has meaning, leave a marker indicating that the value was missing and analyze the data.
D - Impute the mean and analyze data on items where most of the data is missing.
Show answer
(D) Imputing with the mean and analysing items where most of the data is missing.
When most of a column is missing, mean imputation changes the distribution and reduces variance, so you end up analysing mostly invented data. Deleting when little is missing, imputing when gaps are random, and flagging when absence has meaning are all appropriate.
(2)For each of situations (a, b), choose the most appropriate data processing from the choices below (A, B). a You want to align date data with mixed notations such as “2026/4/1,” “2026-04-01,” and “01 Apr 2026.” b You want to compare variables with different units and scales together, such as height (cm) and weight (kg).
A - Data type conversion (standardization of date format)
B - Normalization
Show answer
1 → (A) data type conversion (unifying the date format), 2 → (B) normalization.
Dates in mixed formats need their format unified. Variables with different units and scales, like height and weight, are put on similar ranges with normalization, which matters especially for scale-sensitive algorithms.
(3)From the following options (A–D), choose the one that most appropriately describes the handling of outliers.
A - Outliers are all errors in the data, so delete all of them as soon as they are found.
B - For outliers, identify the cause first; correct or delete them if they are due to input errors, and in principle keep them if they reflect reality.
C - Outliers do not affect analysis, so no special handling is needed.
D - Outliers can always be resolved by replacing them with the mean.
Show answer
(B) Identify the outlier's cause first; correct or delete it if it is an entry error, and in principle keep it if it reflects reality.
Not every outlier is an error (A is wrong), outliers can affect the analysis (C is wrong), and replacing them with the mean is not a universal fix (D is wrong).
Exercise 1
1Cover the Point! section with a red plastic sheet and quiz yourself in your notebook in numerical order.
Show answer
Cover the key-points section and test yourself: define cleaning and transformation, the three responses to missing values, how to handle outliers and duplicates, type change vs format unification, Min–Max vs standardization, and pivot, join and aggregation.
Write a definition and a small example for each term, practise the comparisons especially (Min–Max vs standardization, pivot vs aggregation), then review what you got wrong.
Note: Arabic edition: The English version says to cover the Point! section with a red plastic sheet.
Exercise 2
1Read the following passage and answer each question. If collected data is used directly in analysis, incorrect conclusions may be drawn. For this reason, ( a ), which addresses issues, and ( b ), which arranges the format to fit the purpose of the analysis, are necessary. For missing values, an appropriate response is chosen from deletion, ( c ), and flagging, depending on the proportion of missing values and the purpose of the analysis. Also, when units or ranges differ greatly between variables, the scale is aligned through ( d ), which converts data to a range from 0 to 1, or ( e ), which converts data to a form with mean 0 and standard deviation 1. 1. Fill in the blanks (a)–(e).
Show answer
(1) data cleaning, (2) data transformation, (3) imputation, (4) normalization (Min–Max scaling), (5) standardization.
Finding and handling problems is cleaning; changing formats and structure is transformation. The third response to missing values alongside deletion and flagging is imputation. Converting to 0–1 is Min–Max scaling, and expressing values as standard deviations from the mean is standardization.
Note: Arabic edition: The English passage is worded differently and its blanks are lettered; the required terms are essentially the same.
Exercise 3
(1)From the following options (A–D), choose the one that corresponds to data type conversion.
A - Filling in missing values with the mean.
B - Standardizing notations such as “2026/4/1” and “01 Apr 2026” into “2026-04-01.”
C - Aligning the scales of height and weight to between 0 and 1.
D - Aggregating daily sales into monthly totals.
Show answer
(B) Unifying formats such as '2026/4/1' and '01 Apr 2026' into '2026-04-01'.
Unifying the date format is one of the examples in the book's 'data type conversion' table. Filling missing values is imputation, converting to 0–1 is scaling, and summing daily sales into monthly totals is aggregation.
Note: Arabic edition: The Arabic edition separates type change from format unification in its text, but lists date unification among its data type conversion examples, so the answer is unchanged.
(2)From the following options (A–D), choose the one that most appropriately describes normalization and standardization.
A - Normalization is processing that converts data to a form with mean 0 and standard deviation 1.
B - Standardization is processing that converts data to a range from 0 to 1.
C - Normalization is used to align data with different units into a comparable form.
D - Standardization is used to enlarge the scale of variables.
Show answer
(C) Normalization is used to bring data with different units into a comparable form.
A and B swap the definitions of normalization and standardization. D is wrong because standardization does not aim to 'enlarge' the scale; it expresses distance from the mean in standard-deviation units.
(3)For each processing (a–c), indicate which corresponds to pivot, join, or aggregation. a Connecting a student roster and a grade sheet by “student ID” into a single table. b Calculating monthly totals from daily sales data. c Reshaping daily product sales into the form of a “date × product” table.
A - Pivot
B - Join
C - Aggregation
Show answer
1 → (B) join, 2 → (C) aggregation, 3 → (A) pivot.
Linking the student register to the marks sheet by student ID is a join. Computing monthly totals from daily sales is aggregation. Reshaping daily sales into a 'date × product' table is a pivot.
Exam-style question
Explain, using “garbage in, garbage out,” why data preparation matters as much as the analysis itself. [6] Refer to: one cleaning fix and one transformation. [6]
Model answer
• 'Garbage in, garbage out' means exact calculations on flawed data still give a flawed result; analysis cannot repair the data. [1] • Raw data is rarely ready: it has missing, outlying and duplicate values and mixed formats. [1] • Cleaning fix: a value of 9999 hours in a screen-time survey pushes the average to an impossible number; check its cause, then correct it, delete it, or treat it as missing if it is a code. [1] • For missing values, choose between deletion, imputation and flagging based on the amount, cause and pattern of the gaps, because the wrong choice can distort the distribution. [1] • Transformation: unify mixed date formats into one, otherwise the software treats the same date as different values and monthly aggregation goes wrong. [1] • So preparation determines the quality of the result as much as the analysis does: every cleaning or transformation decision must be justified and its effect checked. [1]