Skip to content
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

DEPR: group by one element list gets scalar keys #59179

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

natmokval
Copy link
Contributor

@natmokval natmokval commented Jul 4, 2024

changed the behavior: group keys to be 1-tuples instead of scalar when grouping with a length-1 list

@natmokval natmokval added Groupby API - Consistency Internal Consistency of API/Behavior labels Jul 14, 2024
@natmokval
Copy link
Contributor Author

natmokval commented Jul 14, 2024

I deprecated the behavior for groups: group keys are now 1-tuples instead of scalars when grouping with a length-1 list.
I fixed the tests except for this one test_groupby_raises_category_on_category in pandas/tests/groupby/test_raises.py. I got errors like:

FAILED pandas/tests/groupby/test_raises.py::test_groupby_raises_category_on_category[by3-False-idxmin-False-agg] - ValueError: Can't get idxmin of an empty group due to unobserved categories. Specify observed=True in groupby instead.

@rhshadrach, could you please advise me on how to fix this test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Inconsistent types for groupby group names
1 participant