Skip to content

CLN: Remove uses of Index._data #19658

Closed
Closed
@TomAugspurger

Description

@TomAugspurger

The type of Index._data is inconsistent across Index subclasses

class output
Index ndarray
PeriodIndex ndarray[int] (ordinals)
DatetimeIndex DatetimeIndex (?)
DatetimeIndex[tz] ndarray[datetime64[ns]]
CategoricalIndex Categorical
IntervalIndex None

We should replace uses of ._data with ._values or ._ndarray_values, which have more consistent behavior.

I don't think we can remove ._data entirely though. It's used for quickly setting values in some places. Haven't looked too closely though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanClosing CandidateMay be closeable, needs more eyeballsInternalsRelated to non-user accessible pandas implementationRefactorInternal refactoring of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions