Get category mapping for categoricals #14883
Labels
A-dtype-categorical
Area: categorical data type
enhancement
New feature or an improvement of an existing feature
Description
While usually internal implementations should remain hidden, categorical data is universally known to be represented by integers, and this representation is often useful to developers. I propose we expose the rev mapping in the API via the following:
Series.cat.get_map
- get map for categorical series as dictionarypl.StringCache.get_map
- get global categorical map.This has also come up on discord a few times. We usually refer people to
s.unique()
, but that does not always show all of the categories.The text was updated successfully, but these errors were encountered: