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 }})

phofl

@phofl

jbrockmendel

@@ -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

mroeschke

@mroeschke mroeschke added Indexing

Related to indexing on series/frames, not to indexes themselves

Performance

Memory or execution speed performance

labels

May 1, 2023

@phofl @mroeschke

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com

@phofl

@phofl

mroeschke

@mroeschke

@phofl phofl deleted the perf_indexing branch

May 4, 2023 18:50

topper-123 pushed a commit to topper-123/pandas that referenced this pull request

May 7, 2023

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


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

May 7, 2023

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


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

May 9, 2023

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


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

May 19, 2023

@phofl @mroeschke

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


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

May 27, 2023

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


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

May 27, 2023

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com

Daquisu pushed a commit to Daquisu/pandas that referenced this pull request

Jul 8, 2023

@phofl @mroeschke

Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com


Co-authored-by: Matthew Roeschke 10647082+mroeschke@users.noreply.github.com

Labels

Indexing

Related to indexing on series/frames, not to indexes themselves

Performance

Memory or execution speed performance