Improve performance when selecting rows and columns by phofl · Pull Request #53014 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
- closes #xxxx (Replace xxxx with the GitHub issue number)
- Tests added and passed if fixing a bug or adding a new feature
- All code checks passed.
- Added type annotations to new arguments/methods/functions.
- Added an entry in the latest
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.
@@ -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 |
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
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 = ...
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
Related to indexing on series/frames, not to indexes themselves
Memory or execution speed performance
labels
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
phofl deleted the perf_indexing branch
topper-123 pushed a commit to topper-123/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
topper-123 pushed a commit to topper-123/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
topper-123 pushed a commit to topper-123/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
topper-123 pushed a commit to topper-123/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
topper-123 pushed a commit to topper-123/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request
Improve performance when selecting rows and columns
Update doc/source/whatsnew/v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Update indexing.py
Update v2.1.0.rst
Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com
Labels
Related to indexing on series/frames, not to indexes themselves
Memory or execution speed performance