Statistics Quest

Customer records (messy)

An export of 700 customer records from the point-of-sale system of a fictional homeware retailer, Rimal Living, deliberately left messy for data-cleaning practice: exact duplicates, inconsistent city spellings, placeholder text, impossible ages, negative spends and a unit mix-up (some spends in halalas instead of riyals). Every planted problem is counted below; the cleaned counterpart is customers_clean.

Rows
700
Columns
8
One row is
one customer record (some customers appear twice)
Version
v1

Data dictionary

ColumnTypeUnitSummaryDescription
customer_id
Customer
idCustomer identifier (repeated in exact duplicate records).
signup_date
Signup date
dateDate the customer account was opened.
city
City
category19 levels; 7 missingCity of residence as typed by staff — inconsistent capitalisation, aliases and stray spaces.Missing: Null where the city was not recorded.
segment
Segment
category2 levels: Individual, Small businessCustomer segment.
age
Age
integeryearsmean 37.21, median 35, SD 15.56, range −1–230; 18 missingAge in years as recorded (contains impossible values).Missing: Null where not recorded.
annual_spend_sar
Annual spend
numberSARmean 12130, median 3511, SD 83150, range −12150–1,762,072; 12 missingSpend over the last 12 months as recorded (a few entries are in halalas, a few are negative).Missing: Null where not recorded.
referral_source
Referral source
textHow the customer heard about the shop, free text (contains placeholder text such as 'N/A' and stray spaces).
email_opt_in
Email opt-in
boolean2 levelsTrue if the customer agreed to receive marketing emails.

What it is good for

  • Profile a dataset to find duplicates, inconsistent categories, placeholders, impossible values and unit errors.
  • Write explicit, reproducible cleaning rules and count how many records each rule changes.
  • Decide when to correct a value, set it to missing, or drop a record — and document the decision.
  • Compare summaries before and after cleaning (e.g. mean spend with and without halala entries).

Methods: data profiling, frequency tables, duplicate detection, string standardisation, range checks, outlier detection, missing-data handling.

Data quality notes

  • Exact duplicate records: 21 (700 rows = 679 unique customers + 21 copies).
  • Inconsistent city spellings: 45 records (case variants such as "RIYADH"/"riyadh", leading/trailing spaces such as "Riyadh ", and aliases "Al Khobar"/"al-khobar" for Khobar).
  • Missing values (null): age 18, city 7, annual_spend_sar 12.
  • Placeholder text in referral_source: "N/A" 14, "unknown" 9, "-" 5 (28 in total) — missing values disguised as text.
  • Leading/trailing whitespace in referral_source: 8 records.
  • Impossible ages: 3 records with −1 and 2 with 230.
  • Negative annual spend: 4 records (refunds netted incorrectly).
  • Unit error: 6 spends recorded in halalas (×100), all above 100 000.
  • Each problem affects a different set of records, and duplicated records carry no other problem, so the counts above hold for the whole table.

Provenance and licence

679 true customer records are simulated (city, segment, age ~ 18 + gamma, spend log-normal by segment, referral source, email opt-in). Problems are then planted in disjoint, randomly chosen records with a separate seeded stream, and 21 records without other problems are duplicated exactly and inserted at random later positions.

Synthetic data · CC0-1.0 (synthetic data generated by Statistics Quest) · generated deterministically (seed 20241025). It does not describe real people or organisations; any resemblance is coincidental.

Preview

Dataset

Customer records (messy)

700 rows · one row = one customer record (some customers appear twice) · synthetic data

CustomerSignup dateCitySegmentAge (years)Annual spend (SAR)Referral sourceEmail opt-in
C00012024-02-28RiyadhSmall business31571670Advertisementtrue
C00022021-07-15JeddahIndividual204679.64Friendtrue
C00032024-08-12DammamSmall business303027.49Advertisementfalse
C00042022-11-14RiyadhIndividual345440.72Searchfalse
C00052022-12-01RiyadhIndividual471382.89Social mediafalse
C00062023-11-01KhobarIndividual374162.73Store visitfalse
C00072022-12-06JeddahIndividual364146.99Friendfalse
C00082023-10-20RiyadhIndividual242789.46Searchfalse
C00092024-08-30KhobarIndividualmissing2828.16Searchfalse
C00102022-12-19JeddahIndividual371536.23Search true
C00112021-10-24JeddahIndividual3210629.29Searchfalse
C00122022-09-06DammamSmall business718058.07Social mediatrue

Used in