ENH: add na_action to Categorical.map & CategoricalIndex.map#51645
ENH: add na_action to Categorical.map & CategoricalIndex.map#51645mroeschke merged 16 commits intopandas-dev:mainfrom
Conversation
5674674 to
10f8606
Compare
6b461b2 to
64b7297
Compare
|
I've updated again. I noticed that the implicit default for So I've set the default value of |
7775e2b to
dc60e20
Compare
1f19c3e to
dc9d119
Compare
|
I’ve simplified the implementation. |
1fc89b7 to
be2d451
Compare
|
Ping. |
| mapped = obj._map_values(mapper=f, convert=self.convert_dtype) | ||
| # apply doesn't have a `na_action` keyword and for backward compat reasons | ||
| # we need to give `na_action="ignore"` for categorical data. | ||
| # TODO: remove the `na_action="ignore"` has been removed from Categorical. |
There was a problem hiding this comment.
Is this supposed to refer to once the deprecation is enforced?
|
|
||
| .. deprecated:: 2.1.0 | ||
|
|
||
| The dault value of 'ignore' has been deprecated and will be changed to |
There was a problem hiding this comment.
| The dault value of 'ignore' has been deprecated and will be changed to | |
| The default value of 'ignore' has been deprecated and will be changed to |
mroeschke
left a comment
There was a problem hiding this comment.
The logic looks a lot simpler thanks. Kinda unfortunate that user will automatically get a deprecation warning, but i think this is okay as map is a fairly uncommon method
|
Thanks @topper-123 |
…dev#51645) * ENH: add na_action to Categorical.map * add GH numbers * pre-commit issues * map Categorical with Series * REF: simplify .map * pass test_map * fix whatsnew * cleanups * pre-commit * deprecate Categorical.map(na_action=ignore) * fix docstrings * fix rebase * simplity implementation * fix warn * fix comments
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.