-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
REF: Apply.apply_multiple #53362
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
REF: Apply.apply_multiple #53362
Conversation
pandas/core/apply.py
Outdated
| """ | ||
| return self.obj.aggregate(self.f, self.axis, *self.args, **self.kwargs) | ||
| if self.axis == 1 and isinstance(self.obj, ABCDataFrame): | ||
| return self.obj.T.apply(self.f, 0, *self.args, **self.kwargs).T |
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.
Needs to be args=self.args, not *self.args. Can you add a test here?
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.
Yeah, good catch. Done.
rhshadrach
left a comment
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
A step towards fixing #53325 (comment).
This avoids the need to call out into
(Series|DataFrame).aggregate. In a follow-up I will replace the use ofagg_(list|dict)_likewithapplyspecific versions of those methds or some similar solution, avoiding needing to callApply.aggfrom withinApply.apply_multiple.CC @rhshadrach