-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.IdeasLong-Term Enhancement DiscussionsLong-Term Enhancement DiscussionsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
There has been discussion in eg #39133 about having EA-backed Indexes held in base-class Index objects, similar discussion regarding the new NumericIndex.
I do not like the idea of having some non-object dtypes return the base class Index, but would be on board for making all dtypes use the base class. i.e. only have Index and deprecate/remove all the subclasses. I'm envisioning roughly
- Implement relevant methods on the underlying EAs, eg DatetimeIndex.get_loc logic might live in DatetimeArray.get_loc.
- ??? for RangeIndex and MultiIndex, maybe make corresponding EAs?
- Methods currently available on subclasses but not Index would be accessed via accessor, e.g.
dti.is_year_start
becomesidx.foo.is_year_start
Related but independent, we could do the same with ExtensionArray subclasses. Instead of having authors implement methods on their EA subclass, they implement it on the ExtensionDtype subclass, which the EA object then dispatches to.
Metadata
Metadata
Assignees
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.IdeasLong-Term Enhancement DiscussionsLong-Term Enhancement DiscussionsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action