Skip to content

Commit c292c5b

Browse files
rhshadrachtopper-123
authored andcommitted
REF/CLN: func in core.apply (#53437)
* REF/CLN: func in core.apply * Remove type-hint
1 parent 2e54b05 commit c292c5b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/core/apply.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1130,13 +1130,10 @@ def agg(self):
11301130
# GH53325: The setup below is just to keep current behavior while emitting a
11311131
# deprecation message. In the future this will all be replaced with a simple
11321132
# `result = f(self.obj)`.
1133-
if isinstance(func, np.ufunc):
1134-
with np.errstate(all="ignore"):
1135-
return func(obj)
11361133
try:
1137-
result = obj.apply(func)
1134+
result = obj.apply(func, args=self.args, **self.kwargs)
11381135
except (ValueError, AttributeError, TypeError):
1139-
result = func(self.obj)
1136+
result = func(obj, *self.args, **self.kwargs)
11401137
else:
11411138
msg = (
11421139
f"using {func} in {type(obj).__name__}.agg cannot aggregate and "

0 commit comments

Comments
 (0)