@@ -3313,7 +3313,7 @@ def apply(self, func, axis=0, broadcast=False, raw=False, reduce=None,
3313
3313
f = func
3314
3314
3315
3315
if len (self .columns ) == 0 and len (self .index ) == 0 :
3316
- return self ._apply_empty_result (func , axis , reduce )
3316
+ return self ._apply_empty_result (func , axis , reduce , * args , ** kwds )
3317
3317
3318
3318
if isinstance (f , np .ufunc ):
3319
3319
results = f (self .values )
@@ -3322,7 +3322,8 @@ def apply(self, func, axis=0, broadcast=False, raw=False, reduce=None,
3322
3322
else :
3323
3323
if not broadcast :
3324
3324
if not all (self .shape ):
3325
- return self ._apply_empty_result (func , axis , reduce )
3325
+ return self ._apply_empty_result (func , axis , reduce , * args ,
3326
+ ** kwds )
3326
3327
3327
3328
if raw and not self ._is_mixed_type :
3328
3329
return self ._apply_raw (f , axis )
@@ -3333,11 +3334,12 @@ def apply(self, func, axis=0, broadcast=False, raw=False, reduce=None,
3333
3334
else :
3334
3335
return self ._apply_broadcast (f , axis )
3335
3336
3336
- def _apply_empty_result (self , func , axis , reduce ):
3337
+ def _apply_empty_result (self , func , axis , reduce , * args , ** kwds ):
3337
3338
if reduce is None :
3338
3339
reduce = False
3339
3340
try :
3340
- reduce = not isinstance (func (_EMPTY_SERIES ), Series )
3341
+ reduce = not isinstance (func (_EMPTY_SERIES , * args , ** kwds ),
3342
+ Series )
3341
3343
except Exception :
3342
3344
pass
3343
3345
0 commit comments