We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e54b05 commit c292c5bCopy full SHA for c292c5b
pandas/core/apply.py
@@ -1130,13 +1130,10 @@ def agg(self):
1130
# GH53325: The setup below is just to keep current behavior while emitting a
1131
# deprecation message. In the future this will all be replaced with a simple
1132
# `result = f(self.obj)`.
1133
- if isinstance(func, np.ufunc):
1134
- with np.errstate(all="ignore"):
1135
- return func(obj)
1136
try:
1137
- result = obj.apply(func)
+ result = obj.apply(func, args=self.args, **self.kwargs)
1138
except (ValueError, AttributeError, TypeError):
1139
- result = func(self.obj)
+ result = func(obj, *self.args, **self.kwargs)
1140
else:
1141
msg = (
1142
f"using {func} in {type(obj).__name__}.agg cannot aggregate and "
0 commit comments