Skip to content
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

Support for indices satisfying the Index API that aren't pandas.Index subclasses #7243

Closed
shoyer opened this issue May 27, 2014 · 2 comments
Closed
Labels
API Design Duplicate Report Duplicate issue or pull request Indexing Related to indexing on series/frames, not to indexes themselves

Comments

@shoyer
Copy link
Member

shoyer commented May 27, 2014

Pandas specifies an Index API in the docs: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-internal-details

However, it's not currently possible (as far as I can tell) to create an object that can be used as a pandas Index unless it's an actual pandas.Index subclass.

From the perspective of someone who would like to be able to create custom Index-like objects, I would prefer not to need to subclass pandas.Index so the implementation details of my index can be decoupled from pandas. I might still use a pandas.Index internally for speed, but in my experience composition is generally easier to reason about than inheritance.

@jreback
Copy link
Contributor

jreback commented May 27, 2014

related #3268

what kind of indicies do you have in mind?

I agree composition is usually better; but in this case what is the problem?

@jreback
Copy link
Contributor

jreback commented May 27, 2014

this is a dupe of #5460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Duplicate Report Duplicate issue or pull request Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

No branches or pull requests

2 participants