Inconsistent categories and safe corrections
Learn the reasoning. Try the task. Compare your answer.
Prepared for DataCareerHub · Curriculum version 2026-10-15.1
By the end of this lesson
- Apply inconsistent categories and safe corrections to the fictional case.
- Record the rule, evidence and validation result.
- Explain a limitation and a defensible next step.
Fictional learning case · Local practice files · No personal data.
Understand the method
Inconsistent categories and safe corrections
Normalisation makes equivalent representations comparable, but it must preserve meaning. Trimming surrounding spaces is often defensible; mapping an abbreviation needs a declared dictionary. A category mapping is a controlled many-to-one transformation, not a fuzzy guess. Store both original and corrected values in a change log. Distinguish an unmapped category from a recognised Other category, because silently combining them hides a quality problem.
Work through the case
Cedar defines web and ONLINE as web; store and shop as store; partner stays partner. Case and surrounding whitespace do not carry business meaning for these channel labels under the teaching contract. SKU is different: P01 is a declared exact identifier. The reference trims surrounding whitespace but does not invent P99 or convert it to P03. It parses prices using decimal arithmetic before converting them to integer cents.
A method you can reproduce
Write the mapping once and apply it to a stripped, lower-case channel. Reject a value that has no mapping. For each accepted changed field record source_row, line_id, field, before, after and rule. Keep the source columns untouched. A complete raw record is retained for rejected rows; accepted-row change logs do not pretend to describe corrections to records that were never accepted. Review every distinct input label against the mapping before trusting grouped totals.
Check your reasoning
Uncontrolled fuzzy matching can join different entities that merely look alike. Never use approximate SKU similarity as proof of identity. Also avoid binary floating-point rounding for contractual cent values: a value with excessive decimal precision should fail the rule rather than be rounded silently.
Further reading: pandas merge validation, pandas melt, Python CSV parsing. These official references support the methods; the case and exercises are authored for DataCareerHub.
Practical exercise
Create the channel map and correction log for accepted records. Explain how ONLINE, surrounding spaces and P99 should be treated. Test a new channel value wholesale in a separate source copy.
Write your answer in learner_worksheet.txt and retain the evidence file. Attempt this before opening the solution.
Open the worked solution
ONLINE maps to web using channel_map_v1; surrounding spaces are recorded by trim_v1. P99 remains unmatched and is quarantined, not guessed. Adding wholesale must create an unmapped_channel rejection until the contract and lookup are deliberately revised. The correction log identifies exact before/after evidence for accepted changes.
Independent extension: change one relevant input in a separate copy. Predict the result first, rerun the checks and explain any difference. Keep the supplied source unchanged.
One more question.
How these learning materials are prepared and maintained · Report a correction: support@datacareerhub.io
Read and practice without an account. Sign in with an existing account to save lesson completion.
Next lesson →This is a fictional learning case. Results do not establish real-world performance or causal effects. Portfolio practice is not a claim of client work or an accredited qualification. Explore practical lessons, worked examples and projects. Follow a published path, practise the method and build work you can explain.