Skip to content
Opensource internals
  • Posts

Categorical

Polars' Categorical Encoding Hides a Global Mutable Dictionary in Plain Sight

Oct 21, 2026 13 min read Jay Hubbert

The categorical dtype is a thin wrapper over a global, lock-free string-to-u32 dictionary. The trick turns group-by and joins into integer work; the same shared state leaks across …

PolarsInternalsPerformanceCategoricalCaching

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·