Nº 18Data cleanup

Fernhollow Supply Co.: a customer list cleanup

A Python script that cleaned a messy 250-row customer CSV for a supply company. Formats were fixed, 34 repeats were merged into the customers they belong to, every change was logged, and the 15 judgment calls were left for a person instead of guessed.

Customer list cleanup page: 250 messy rows in, 211 clean customers out, with a panel showing 5 junk rows dropped, 34 repeats merged and 1,187 cells fixed
Fig. 1 · Customer list cleanup

A closer look

What's in it

  1. 250 rows in, 211 customers out: 5 junk rows dropped and 34 repeats merged
  2. Thirteen cleaning rules, 1,187 cells fixed, each one logged with its before, after and rule
  3. Repeat matching on email, phone or name plus ZIP, with a name check so two businesses sharing one email are not merged
  4. Same name in another town kept as a second location
  5. 15 questions left for a person instead of guesses: missing digits, emails without an @, look-alike names
  6. An Excel workbook with Clean, Changes, Duplicates, Needs Review, Removed and Original tabs, plus the same outputs as CSV
  7. Standard library Python with 37 tests

Want something like this?

alexmercer.projects@gmail.com

Email me the job and we can talk it through.

Email Alex