1. 학습
  2. /
  3. 강의
  4. /
  5. Scaling and Optimizing Data Pipelines with Polars

Connected

연습 문제

Using a categorical expression

The team wants a quick flag for movies whose original_language code starts with e (English, Estonian, …). Polars' categorical namespace has its own string-like expressions that work directly on the encoded column, no cast back to String needed.

movies_cat is available with original_language already cast to pl.Categorical.

지침

100 XP
  • Use the categorical namespace to check whether original_language starts with "e".
  • Alias the new boolean column as starts_with_e.