@@ -26,7 +26,6 @@ def frame_apply(
26
26
axis : Axis = 0 ,
27
27
raw : bool = False ,
28
28
result_type : Optional [str ] = None ,
29
- ignore_failures : bool = False ,
30
29
args = None ,
31
30
kwds = None ,
32
31
):
@@ -43,7 +42,6 @@ def frame_apply(
43
42
func ,
44
43
raw = raw ,
45
44
result_type = result_type ,
46
- ignore_failures = ignore_failures ,
47
45
args = args ,
48
46
kwds = kwds ,
49
47
)
@@ -84,13 +82,11 @@ def __init__(
84
82
func ,
85
83
raw : bool ,
86
84
result_type : Optional [str ],
87
- ignore_failures : bool ,
88
85
args ,
89
86
kwds ,
90
87
):
91
88
self .obj = obj
92
89
self .raw = raw
93
- self .ignore_failures = ignore_failures
94
90
self .args = args or ()
95
91
self .kwds = kwds or {}
96
92
@@ -283,29 +279,14 @@ def apply_series_generator(self) -> Tuple[ResType, "Index"]:
283
279
284
280
results = {}
285
281
286
- if self .ignore_failures :
287
- successes = []
282
+ with option_context ("mode.chained_assignment" , None ):
288
283
for i , v in enumerate (series_gen ):
289
- try :
290
- results [i ] = self .f (v )
291
- except Exception :
292
- pass
293
- else :
294
- successes .append (i )
295
-
296
- # so will work with MultiIndex
297
- if len (successes ) < len (res_index ):
298
- res_index = res_index .take (successes )
299
-
300
- else :
301
- with option_context ("mode.chained_assignment" , None ):
302
- for i , v in enumerate (series_gen ):
303
- # ignore SettingWithCopy here in case the user mutates
304
- results [i ] = self .f (v )
305
- if isinstance (results [i ], ABCSeries ):
306
- # If we have a view on v, we need to make a copy because
307
- # series_generator will swap out the underlying data
308
- results [i ] = results [i ].copy (deep = False )
284
+ # ignore SettingWithCopy here in case the user mutates
285
+ results [i ] = self .f (v )
286
+ if isinstance (results [i ], ABCSeries ):
287
+ # If we have a view on v, we need to make a copy because
288
+ # series_generator will swap out the underlying data
289
+ results [i ] = results [i ].copy (deep = False )
309
290
310
291
return results , res_index
311
292
0 commit comments