Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1IF age < 0 OR age > 120 THEN flag the row as an error | AA mark over 100 is an impossible value (if marks are out of 100), so the row should be flagged or fixed, not kept as valid. | |
| 2IF name = "" THEN mark the value as missing | BChecks for impossible values (such as a negative age) and flags the row so it can be fixed or removed | |
| 3Removing duplicate rows: only add a record to the clean list if its ID has not been seen before | CDeleting all rows with missing values without checking can throw away lots of useful data and bias the results. | |
| 4Fixing spelling variations by converting text to one consistent format before comparing | DFinds a missing value (an empty field) so it can be filled in, replaced or excluded | |
| 5IF mark > 100 THEN keep the row as valid | Ecity <- UPPERCASE(TRIM(city)) | |
| 6Delete every row that has a missing value, without checking how many rows are lost | FIF id NOT IN seenIds THEN add record to cleanList |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
data cleaning — Finding and fixing mistakes in data, such as typos, spelling variations, duplicate rows, missing values and impossible values, so the data is accurate and ready to use.if age < 0 or age > 120 then
delete row
end iffor each row in data
if row.id in seen then delete row
add row.id to seentotal ← 0
for each mark in marks
if mark ≠ "" then total ← total + markcleaned ← empty list
for each row in data
if valid(row) then add row to cleanedif mark > 100 then
print "Impossible mark"
end if