Data Cleaning Exercises

Dataset pack

Members, postcodes and opt-in flags

Member records with leading-zero identifiers and opt-in flags written many ways.

Fictional data · UTF-8 CSV, every value quoted so padding and leading zeros survive; empty fields are missing values · free for personal and classroom practice · practise it in Keep identifiers as text and parse yes/no flags.

members 17 rows × 3 columns

Download members.csv

Data dictionary

member_id
Six-digit member ID with leading zeros; unique.
postcode
Five-digit postcode with leading zeros; may be padded or missing.
opted_in
Opt-in answer as typed (Y, yes, TRUE, 1, N, …); may be missing or unrecognized.
member_idpostcodeopted_in
"008417""98506 ""true"
"000002"" 02139 ""maybe"
"002939"∅"0"
"015246"" 51389""y"
"077927"" 08222""N"
"092803""30041""true"

Values are shown in quotes so leading and trailing spaces are visible. ∅ means the cell is missing. Exercises are also graded on hidden datasets that are never published.