O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Categorical values as an index - CategoricalIndex

A CategoricalIndex is used to represent a sparsely populated index for an underlying Categorical. The following creates a DataFrame with one column being a Categorical.

Shifting categorical column (B) into the index of the DataFrame shows that there is now a CategoricalIndex.

And lookups can then be performed using existing values in the underlying categorical.

Categoricals will be examined in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required