Module 5 · Data that arrives dirty

Categories: canonical values, mapping tables and encoding for a model

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 9 of 12 in this chapter

This chapter’s goalLoad an exported CSV with mixed encodings, ambiguous dates and duplicate rows into a typed, deduplicated table by re-runnable query with every dropped row counted, decide and document what each missing value means, and produce a feature table for a model in which no column knows anything that happened after its row’s timestamp.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

A category is a value from a list, and the list is the asset

status, city, plan, channel: columns whose values come from a set rather than a range. A number column is cleaned by casting; a category column is cleaned by deciding what the set is and mapping everything onto it. The set is the thing to write down, because the day it exists only inside a long CASE expression is the day two reports disagree about how many plans there are.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Building Apps with AI exam.

Stuck on something?Ask Divya, your AI tutor

How to cite: Addaly (2026) ‘Categories: canonical values, mapping tables and encoding for a model’, in Data, SQL and Getting to the Answer. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/data-and-sql/categories-and-encoding (Accessed: 29 November 2026).