Skip to content

DEPR/API: Series[categorical].replace behavior #55147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jbrockmendel opened this issue Sep 15, 2023 · 0 comments · Fixed by #56385
Closed

DEPR/API: Series[categorical].replace behavior #55147

jbrockmendel opened this issue Sep 15, 2023 · 0 comments · Fixed by #56385
Labels
Deprecate Functionality to remove in pandas replace replace method

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Sep 15, 2023

Discussed briefly at the sprint and achieved consensus:

NDFrame.replace behaves differently with Categorical dtypes than it does with everything else (the special casing occurs in Block.replace and Block.replace_list), changing the dtype in addition to the values. We should deprecate this behavior to make it consistent with other dtypes and tell users to go through e.g. ser.cat.rename_categories instead (not quite as easy as that since rename_categories is only equivalent in some of the affected cases)

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 15, 2023
@lithomas1 lithomas1 added Deprecate Functionality to remove in pandas replace replace method and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas replace replace method
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants