-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
[WIP] Add basic ExtensionIndex class #23223
Conversation
Hello @jorisvandenbossche! Thanks for updating the PR.
Comment last updated on October 19, 2018 at 13:41 Hours UTC |
Interesting, this is less work than I expected. If I were to do |
|
||
@property | ||
def values(self): | ||
""" return the underlying data as an ndarray """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ndarray -> extension array.
That might also be because I didn't yet test that much :)
Indeed:
That's the small change in |
Ah, I completely overlooked that. |
Putting here a comment I already wrote a time ago, but the actual discussion can maybe go in #23565 The main question here is: which values to use for indexing? Currently, in this PR I tried to create the correct indexing Engine based on the values of However, in many cases, we are using |
Just thinking out loud here: For IntegerArray, one could in principle write an engine that uses Regardless, I'm ok with a default "ExtensionIndex" (an Index with the extension |
But that would mean writing a custom engine? Anyway (also future wise), an engine that works with values/mask combination might be useful in general. I suppose short term the easiest is to use the object dtype values for IntegerArray for all indexing related things. |
Right, it would push more work onto the EA author (which is us for IntegerArray). Pandas would provide the hooks somewhere in engine = getattr(ExtensionArray, '_index_engine', default_engine)
Agreed. Ensuring that |
nice idea for 0.25 :> |
good idea, but needs a reboot. |
Still hoping for this feature! |
I'm wondering what the current thoughts on this issue are wrt to Is it being considered a non issue or a different work around being put in place? |
see #22861 |
Explored this a bit 2 weeks ago, so thought could open it as a WIP PR in case it might serve discussion.
For me, the main question is how "complete" we want this to be, before we consider merging it. This WIP certainly already is able to preserve the EA in the Index (not convert to objects), and basic indexing works (but only tested the basics, and not all combinations of uniques/duplicated, sorted/non-sorted ... indexes)
Closes #22861