ENH: add na_action to Categorical.map & CategoricalIndex.map by topper-123 · Pull Request #51645 · pandas-dev/pandas (original) (raw)

I've updated again. I noticed that the implicit default for na_action is "ignore" for Categorical.map, while it's None generally. This is a bit of an issue because e.g. Series.map has a default of None and that can't be changed, so there's some mismatch when calling the Categorical directly compared to doing it through Series.map.

So I've set the default value of na_action="ignore" in Categorical.map as being deprecated and set to be changed in the next version.