1. Learn
  2. /
  3. Cursuri
  4. /
  5. Scaling and Optimizing Data Pipelines with Polars

Connected

exercițiu

Creating a Categorical column

Back to the movie dataset from the streaming startup. Most rows in original_language use the same handful of codes (en, fr, es, …). Casting to Categorical encodes each unique label as an integer behind the scenes, saving memory on repeated strings.

Instrucțiuni

100 XP
  • Cast the original_language column to pl.Categorical.