Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2e54b05

Browse files
committedJun 6, 2023
some cleanups
1 parent 9bb2b87 commit 2e54b05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎pandas/core/apply.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ def agg_or_apply_list_like(
324324
is_groupby = isinstance(obj, (DataFrameGroupBy, SeriesGroupBy))
325325

326326
is_ser_or_df = isinstance(obj, (ABCDataFrame, ABCSeries))
327+
this_args = [self.axis, *self.args] if is_ser_or_df else self.args
328+
327329
context_manager: ContextManager
328330
if is_groupby:
329331
# When as_index=False, we combine all results using indices
@@ -342,7 +344,6 @@ def include_axis(colg) -> bool:
342344
if selected_obj.ndim == 1:
343345
for a in func:
344346
colg = obj._gotitem(selected_obj.name, ndim=1, subset=selected_obj)
345-
this_args = [self.axis, *self.args] if is_ser_or_df else self.args
346347
new_res = getattr(colg, op_name)(a, *this_args, **kwargs)
347348
results.append(new_res)
348349

@@ -354,7 +355,6 @@ def include_axis(colg) -> bool:
354355
indices = []
355356
for index, col in enumerate(selected_obj):
356357
colg = obj._gotitem(col, ndim=1, subset=selected_obj.iloc[:, index])
357-
this_args = [self.axis, *self.args] if is_ser_or_df else self.args
358358
new_res = getattr(colg, op_name)(func, *this_args, **kwargs)
359359
results.append(new_res)
360360
indices.append(index)

0 commit comments

Comments
 (0)
Please sign in to comment.