-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Multi-dimensional Index indexing followups #30867
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
Comments
I added deprecation for the Series case |
Currently, you get the following warning:
which is not very friendly. Eg when running tests you get:
which seems like that the deprecation warning is coming from code in pandas itself (which also is the case, it's just that indexing Series with 2d then also indexes into the Index). You get a message about the index, while you are using a Series. So we should add a proper message for Series itself. |
I think this is a blocker as well cc @TomAugspurger @jbrockmendel Or at least the non-test-clean-up part (so eg Series deprecation) |
Can the exception raised be |
For now, it should only raise a deprecation warning, and not yet an error (the error in the linked PR is if you explicitly construct an Index with eg |
It is clear that it is just warning for now, but on the Matplotlib side I am banking on it raising either |
Ah, OK, I understand. @jbrockmendel opinion on this? |
* Avoid Index DeprecationWarning in Series getitem xref #30867
IndexError strikes me as weird here, but if numpy does it I guess we can go along. ValueError sounds a bit better than TypeError, but I agree that choosing something and being consistent is more important than the exact choice. Another alternative would be to raise InvalidIndexError (which we can document the meaning of more precisely), and have that subclass LookupError for matplotlib to catch. |
For xref purposes matplotlib/matplotlib#16347 is how we are currently going to handle this. |
All the 1.0 related items have been fixed I think. |
I noticed that I did a mistake when I was synchronizing my fork and I was added as one of the authors in the later commit reference (as seen above). Please, ignore it. |
I think all the issues in the top post have been addressed so closing. Can reopen individual issues if any are outstanding |
Series.__getitem__
as well, similar toIndex.__getitem__
The text was updated successfully, but these errors were encountered: