@@ -166,19 +166,15 @@ def agg(self) -> Optional[FrameOrSeriesUnion]:
166
166
args = self .args
167
167
kwargs = self .kwargs
168
168
169
- _axis = kwargs .pop ("_axis" , None )
170
- if _axis is None :
171
- _axis = getattr (obj , "axis" , 0 )
172
-
173
169
result = self .maybe_apply_str ()
174
170
if result is not None :
175
171
return result
176
172
177
173
if is_dict_like (arg ):
178
- return self .agg_dict_like (_axis )
174
+ return self .agg_dict_like ()
179
175
elif is_list_like (arg ):
180
176
# we require a list, but not a 'str'
181
- return self .agg_list_like (_axis = _axis )
177
+ return self .agg_list_like ()
182
178
183
179
if callable (arg ):
184
180
f = obj ._get_cython_func (arg )
@@ -317,15 +313,10 @@ def transform_str_or_callable(self, func) -> FrameOrSeriesUnion:
317
313
except Exception :
318
314
return func (obj , * args , ** kwargs )
319
315
320
- def agg_list_like (self , _axis : int ) -> FrameOrSeriesUnion :
316
+ def agg_list_like (self ) -> FrameOrSeriesUnion :
321
317
"""
322
318
Compute aggregation in the case of a list-like argument.
323
319
324
- Parameters
325
- ----------
326
- _axis : int, 0 or 1
327
- Axis to compute aggregation on.
328
-
329
320
Returns
330
321
-------
331
322
Result of aggregation.
@@ -335,9 +326,6 @@ def agg_list_like(self, _axis: int) -> FrameOrSeriesUnion:
335
326
obj = self .obj
336
327
arg = cast (List [AggFuncTypeBase ], self .f )
337
328
338
- if _axis != 0 :
339
- raise NotImplementedError ("axis other than 0 is not supported" )
340
-
341
329
if obj ._selected_obj .ndim == 1 :
342
330
selected_obj = obj ._selected_obj
343
331
else :
@@ -404,15 +392,10 @@ def agg_list_like(self, _axis: int) -> FrameOrSeriesUnion:
404
392
) from err
405
393
return result
406
394
407
- def agg_dict_like (self , _axis : int ) -> FrameOrSeriesUnion :
395
+ def agg_dict_like (self ) -> FrameOrSeriesUnion :
408
396
"""
409
397
Compute aggregation in the case of a dict-like argument.
410
398
411
- Parameters
412
- ----------
413
- _axis : int, 0 or 1
414
- Axis to compute aggregation on.
415
-
416
399
Returns
417
400
-------
418
401
Result of aggregation.
@@ -422,9 +405,6 @@ def agg_dict_like(self, _axis: int) -> FrameOrSeriesUnion:
422
405
obj = self .obj
423
406
arg = cast (AggFuncTypeDict , self .f )
424
407
425
- if _axis != 0 : # pragma: no cover
426
- raise ValueError ("Can only pass dict with axis=0" )
427
-
428
408
selected_obj = obj ._selected_obj
429
409
430
410
arg = self .normalize_dictlike_arg ("agg" , selected_obj , arg )
@@ -1007,7 +987,6 @@ def agg(self):
1007
987
1008
988
# we can be called from an inner function which
1009
989
# passes this meta-data
1010
- kwargs .pop ("_axis" , None )
1011
990
kwargs .pop ("_level" , None )
1012
991
1013
992
# try a regular apply, this evaluates lambdas
0 commit comments