Skip to content

Non-Deep copy for Categorical? #26995

Closed
@jbrockmendel

Description

@jbrockmendel

Categorical.copy passes values=self._codes.copy(), and doesn't have a deep=False kwarg (which the base ExtensionArray does). This is causing trouble in #26954. Is this intentional @TomAugspurger?

Pandas-internal EAs with copy behavior not respecting deep kwarg:

  • Categorical (no kwarg at all)
  • DatetimeLike (ignores kwarg)
  • PandasArray

IntegerArray, IntervalArray, and SparseArray look correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions