Skip to content

ENH: regex replace capacities are missing from pd.Categorical.replace() #38447

Open
@oguzhanogreden

Description

@oguzhanogreden

Is your feature request related to a problem?

pd.Categorical doesn't implement regex=, preventing a generalisable solution at #32542.

Describe the solution you'd like

As far as I can tell, the best solution would be an refactor of .replace() methods and logic.

API breaking implications

Describe alternatives you've considered

Parts of the logic from array_algos.replace.replace_regex() can be copied over to pd.Categorical, but that's not desirable. Therefore the suggestion for the refactor.

Additional context

This came up while working with the suggestion here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions