-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Remove Ambiguous Behavior of Tuple as Grouping #29755
Conversation
pandas/core/groupby/groupby.py
Outdated
Hashable, | ||
List[Hashable], | ||
Callable[[Hashable], Hashable], | ||
List[Callable[[Hashable], Hashable]], |
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.
Pretty large signature and maybe worth trimming down / cleaning up (see #22278) but documenting as-is state
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.
yikes. maybe a comment pointing to the relevant issue?
"b": [1, 2, 2, 2], | ||
("a", "b"): [1, 1, 1, 1], | ||
"a": [2, 2, 2, 2], | ||
"b": [2, 2, 2, 2], | ||
"c": [1, 1, 1, 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.
why does this dataframe need to change? the rest of the test change makes sense
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.
Didn't need to just figured easier to disambiguate between this and the respective a / b columns if they have entirely different values
@@ -343,14 +345,23 @@ def _group_selection_context(groupby): | |||
groupby._reset_group_selection() | |||
|
|||
|
|||
_KeysArgType = Union[ |
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.
this is a monster. can you add some descriptions to it on each line (followon ok); maybe this should be in _typing?
thanks @WillAyd small followon request. |
My mistake - should be updated now |
follow up to #18314