Customer records (cleaned)
The cleaned counterpart of customers_messy for the fictional retailer Rimal Living: the same records after applying six documented cleaning rules. Use it to check your own cleaning decisions — and to discuss the ones that are judgement calls (setting impossible ages to missing rather than guessing, converting halala entries rather than dropping them).
- Rows
- 679
- Columns
- 8
- One row is
- one customer
- Version
- v1
Data dictionary
| Column | Type | Unit | Summary | Description |
|---|---|---|---|---|
customer_idCustomer | id | Customer identifier (unique after de-duplication). | ||
signup_dateSignup date | date | Date the customer account was opened. | ||
cityCity | category | 5 levels: Riyadh, Jeddah, Dammam, Khobar, Abha; 7 missing | City of residence, standardised to one spelling.Missing: Null where the city was not recorded. | |
segmentSegment | category | 2 levels: Individual, Small business | Customer segment. | |
ageAge | integer | years | mean 36.85, median 35, SD 11.29, range 19–82; 23 missing | Age in years; impossible values were set to null.Missing: Null where not recorded or where the recorded value was impossible (< 16 or > 110). |
annual_spend_sarAnnual spend | number | SAR | mean 5481, median 3519, SD 5928, range 319.8–60000; 16 missing | Spend over the last 12 months in SAR (halala entries converted, negative entries removed).Missing: Null where not recorded or where the recorded value was negative. |
referral_sourceReferral source | category | 5 levels: Search, Friend, Social media, Store visit, Advertisement; 28 missing | How the customer heard about the shop.Missing: Null where the raw value was a placeholder ('N/A', 'unknown', '-'). | |
email_opt_inEmail opt-in | boolean | 2 levels | True if the customer agreed to receive marketing emails. |
What it is good for
- Verify a cleaning pipeline by comparing your output with a reference result.
- Quantify how cleaning changes summaries (row count, mean spend, missingness).
- Discuss which cleaning steps are rules and which are judgement calls.
Methods: data validation, missing-data summaries, before/after comparison.
Data quality notes
- 679 rows (the 21 exact duplicates removed).
- Nulls: age 23 (18 originally missing + 5 impossible), city 7, annual_spend_sar 16 (12 missing + 4 negative), referral_source 28 (placeholders).
- 6 halala entries converted to SAR; 45 city spellings standardised; 8 referral values trimmed.
- Remaining missing values are genuine unknowns; they were not imputed.
Provenance and licence
Generated by running the customers_messy generator and then applying, in order: (1) drop exact duplicate rows, keeping the first occurrence; (2) city: trim spaces, lower-case and map spellings and aliases to one canonical name (Riyadh, Jeddah, Dammam, Khobar, Abha); (3) referral_source: trim spaces and turn placeholders "N/A", "unknown", "-" (any case) into null; (4) age outside 16–110 → null; (5) negative annual_spend_sar → null; (6) annual_spend_sar above 100,000 → divided by 100 (halalas to SAR).
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 (cleaned)
679 rows · one row = one customer · synthetic data
| Customer | Signup date | City | Segment | Age (years) | Annual spend (SAR) | Referral source | Email opt-in |
|---|---|---|---|---|---|---|---|
| C0001 | 2024-02-28 | Riyadh | Small business | 31 | 5716.7 | Advertisement | true |
| C0002 | 2021-07-15 | Jeddah | Individual | 20 | 4679.64 | Friend | true |
| C0003 | 2024-08-12 | Dammam | Small business | 30 | 3027.49 | Advertisement | false |
| C0004 | 2022-11-14 | Riyadh | Individual | 34 | 5440.72 | Search | false |
| C0005 | 2022-12-01 | Riyadh | Individual | 47 | 1382.89 | Social media | false |
| C0006 | 2023-11-01 | Khobar | Individual | 37 | 4162.73 | Store visit | false |
| C0007 | 2022-12-06 | Jeddah | Individual | 36 | 4146.99 | Friend | false |
| C0008 | 2023-10-20 | Riyadh | Individual | 24 | 2789.46 | Search | false |
| C0009 | 2024-08-30 | Khobar | Individual | missing | 2828.16 | Search | false |
| C0010 | 2022-12-19 | Jeddah | Individual | 37 | 1536.23 | Search | true |
| C0011 | 2021-10-24 | Jeddah | Individual | 32 | 10629.29 | Search | false |
| C0012 | 2022-09-06 | Dammam | Small business | 71 | 8058.07 | Social media | true |
Used in
- Making and documenting cleaning decisions · Practical Data Analysis
- Writing an analysis report · Practical Data Analysis
- Reproducible analysis · Practical Data Analysis