-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
InternalsRelated to non-user accessible pandas implementationRelated to non-user accessible pandas implementationRefactorInternal refactoring of codeInternal refactoring of code
Milestone
Description
cc @mroeschke w/r/t rolling ._apply, @WillAyd w/r/t _cython_agg_blocks, and anyone else w/r/t DataFrame._reducewith numeric_only=None, apply.FrameApply with ignore_failures=True.
All of these do something along the lines of:
results = []
exclude = []
for i, block in enumerate(mgr.blocks):
try:
res = func(block.values)
results.append(res)
except:
exclude.append(i)
out = reconstruct(results, exclude)
Two things should be done with this pattern:
- Deprecate it, since it is a disproportionate maintainence burden
- implement something like
BlockManager.apply_with_ignore_failuresthat would resemble BlockManager.apply but with the try/except logic*
* We could add that logic into BlockManager.apply, but BM.apply assumes the output has the same shape as the original frame, which I don't think holds for the cases mentioned above, so that would be a little more invasive than just adding a try/except.
Metadata
Metadata
Assignees
Labels
InternalsRelated to non-user accessible pandas implementationRelated to non-user accessible pandas implementationRefactorInternal refactoring of codeInternal refactoring of code