Skip to content

Commit 04b0f07

Browse files
committed
PERF: groupby / frame apply optimization
1 parent 9857a0e commit 04b0f07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/groupby.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ def apply(self, func, *args, **kwargs):
635635

636636
@wraps(func)
637637
def f(g):
638-
# ignore SettingWithCopy here in case the user mutates
639-
with option_context('mode.chained_assignment',None):
640-
return func(g, *args, **kwargs)
638+
return func(g, *args, **kwargs)
641639

642-
return self._python_apply_general(f)
640+
# ignore SettingWithCopy here in case the user mutates
641+
with option_context('mode.chained_assignment',None):
642+
return self._python_apply_general(f)
643643

644644
def _python_apply_general(self, f):
645645
keys, values, mutated = self.grouper.apply(f, self._selected_obj,

0 commit comments

Comments
 (0)