Skip to content

CLN: MultiIndex and Index no longer inherit from ndarray. #5080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jtratner opened this issue Oct 2, 2013 · 0 comments · Fixed by #7891
Closed

CLN: MultiIndex and Index no longer inherit from ndarray. #5080

jtratner opened this issue Oct 2, 2013 · 0 comments · Fixed by #7891
Assignees
Labels
API Design Internals Related to non-user accessible pandas implementation MultiIndex
Milestone

Comments

@jtratner
Copy link
Contributor

jtratner commented Oct 2, 2013

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Internals Related to non-user accessible pandas implementation MultiIndex
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants