-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: weird behaviour for returning group in groupby.apply #22546
Comments
That looks very weird indeed! Investigation and PR are welcome! |
Closed
Closed
5 tasks
5 tasks
take |
I think this is another issue that falls under #34998 |
3 tasks
I think I've encountered this bug, had groupby().apply() and groupby().transform() statements both "with no attempt to actually group the results like the second output." anyone know what is happening here? |
Thanks @smithto1 - agreed. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying to document my experiences with the inconsistencies of
DataFrame.groupby.apply
(see #22545), and one of them was the following:Then, even though the result returned by the function is exactly the same, the following outputs are different:
The first one just returns the original frame as-is, with no attempt to actually group the results like the second output. Furthermore, both outputs should not have the
id
column anymore, which is now ambiguous between the index and the columns (e.g. in case one may continue withgroupby
after some further transformations)Desired output of both:
The text was updated successfully, but these errors were encountered: