CLN: MultiIndex and Index no longer inherit from ndarray. · Issue #5080 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@jtratner

Description

@jtratner

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).


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