-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: index of group not returned correctly in groupby.apply #22541
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
Comments
Think you may have a typo in your example - can you double check? |
@WillAyd Sorry, kept simplifying the example and messed up. Code working now, issue persists. |
OK thanks. As you mentioned this is a pretty unusual use of apply but nonetheless PRs and investigation are always welcome |
Closed
Closed
phofl
added a commit
to phofl/pandas
that referenced
this issue
Mar 28, 2020
4 tasks
jreback
pushed a commit
that referenced
this issue
Mar 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Returning the index of a group is admittedly a somewhat unusual use of
apply
(since the information is available ingroups
), but it's clearly legal and shouldn't be wrong.The issue is that the result of last group gets wrongly broadcast to all groups
Interestingly, with adding any operation I've tried, the behaviour is correct again:
The text was updated successfully, but these errors were encountered: