A traceable data-cleaning workflow

Reliable analysis begins by defining what one row represents and how a trustworthy record should look. A cleaning decision should leave enough evidence for another analyst to reconstruct both the original table and the reason for every change.

Define the records

Specify the observational unit, expected fields, valid ranges, and record key before searching for errors. Record where and when the data were collected, because the same measurement may be legitimate in separate observations. A repeated key can signal a duplicate, but equal measured values alone cannot establish that two rows are copies.


Keep the raw data intact and work in a separate cleaned table. For every change, maintain an audit trail with the affected record, the rule used, and the before and after values. A correction supported by a source record has a different basis from an imputation or exclusion based on assumptions.

Check fields before choosing a rule

A missing value is not a measured zero. A blank cell, a documented instrument code, and a valid reading of zero may need different treatment. Inspect collection notes and count each kind of issue before deciding whether to recover, flag, impute, or exclude a value.


Perform unit standardization before comparing numerical fields. Check impossible entries against documented measurement rules, and retain the original entry when flagging it. A plausible extreme value warrants investigation, not automatic deletion; its effect on an analysis can be assessed separately if it matters to the result.

Worked example

Suppose a weather archive uses one row per station and calendar date, and one imported row repeats an earlier row byte for byte.


The station and date identify the observation, so the repeated import can be removed from the working table after the duplicate is logged. A matching temperature on another date remains a separate observation.


Suppose one temperature is stored as 86 °F and the clean table uses Celsius. Convert it as (86−32)×5/9=30(86-32)\times 5/9=30 °C, while preserving 86 °F in the raw archive. Report the number of rows affected by each rule so the final sample can be reconciled with the original.



A lab export has 80 rows. One row has a blank reaction-time field; another explicitly records 0 ms because the sensor reset. Which first cleaning step preserves the evidence?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A logger table has columns device_id, timestamp, and temperature. Device A reports 21 °C at 09:00 and 21 °C at 09:05; an import also repeats the entire 09:00 row byte-for-byte. Each device should have one row per timestamp. Which action matches that rule?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A shipment table mixes 0.75 kg and 900 g in a mass column. After converting both to grams, what values should the cleaned column contain?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors