CLN: MultiIndex and Index no longer inherit from ndarray. · Issue #5080 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Changing to not be an ndarray subclass should make a number of things simpler (especially the API unification discussed in #3268). Plus, it will clarify the required interface for an Index object. It avoids all the workarounds to make Index immutable (instead, will define __array__
and __array_wrap__
and choose which other functions should be allowed).
- [ ] Move Index underlying data to
_data
to mirror other objects. Keep metadata on object itself. (MI should work with only minor tweaks, given that it was always a fake ndarray) - [ ] Reimplement fastpath. (figure out how to do this inference again).
- [ ] Move MI underlying data to
_data
(potentially turn levels into 2d int64 ndarray and keep labels as list of lists or as ordered-dict-like. not sure whether row-major or column-major makes more sense. I'm guessing row-major since that would speed key lookups)
How much backwards compatibility do we need to support? (pickle compat should be simple). E.g. do we want to do something like this:
def getattr(self, attr):
res = getattr(self._data, attr)
warnings.warn("Accessing %s on %s is deprecated. Convert to an ndarray first." %
(attr, self.class.name))
return res