-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Improve performance when selecting rows and columns #53014
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
Conversation
@@ -933,7 +933,8 @@ def _getitem_tuple_same_dim(self, tup: tuple): | |||
This is only called after a failed call to _getitem_lowerdim. | |||
""" | |||
retval = self.obj | |||
for i, key in enumerate(tup): | |||
for i, key in enumerate(reversed(tup)): | |||
i = self.ndim - i - 1 |
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.
Comment about why doing it this way, otherwise future-me might try to “simplify” it
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.
Can also put this right before retval = ...
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.
Added a comment, prefer keeping it here. We might miss this if we use i before this at some point
Co-authored-by: Matthew Roeschke <[email protected]>
Thanks @phofl |
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Improve performance when selecting rows and columns * Update doc/source/whatsnew/v2.1.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update indexing.py * Update v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.