-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: use public indexers in groupby.ops #31814
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
@@ -780,7 +780,11 @@ def get_iterator(self, data: FrameOrSeries, axis: int = 0): | |||
Generator yielding sequence of (name, subsetted object) | |||
for each group | |||
""" | |||
slicer = lambda start, edge: data._slice(slice(start, edge), axis=axis) | |||
if axis == 0: |
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.
a more natural idiom (used in many places is)
indexer = [None] * 2
indexer[axis] = slice(start, edge)
slicer = data.iloc[indexer]
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.
i guess, but thats not really conducive to being a lambda
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.
why does this need to be a lamba?
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.
doesnt have to be, thats just the pattern we have now. i find iloc[:, start:end]
clearer than the 3-line version
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.
ok
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.
Lgtm outside of Jeff’s comment(s)
No description provided.