Skip to content

DEPR: pd.Categorical #55550

Open
Open
@jbrockmendel

Description

@jbrockmendel

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

NA

Issue Description

Categorical predates general EAs, and is the only EA directly in the pandas namespace. Could we deprecate Categorical as being public and tell users to user Series[cat] or CategoricalIndex instead?

Having it be public makes it modestly harder to make improvements. e.g. #40996 would be easier to implement if it weren't user facing.

union_categoricals is public and operates on Categoricals, which would be weird if Categorical were made private. Maybe something like #51362 making pd.concat behave like union_categoricals would make union_categoricals unnecessary?

On the flip side, Categorical is special, and some of the special-casing of it internally isn't likely to go away. So maybe we just live with it?

Expected Behavior

NA

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    CategoricalCategorical Data TypeDeprecateFunctionality to remove in pandas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions