Skip to content

Commit efb091e

Browse files
committed
PERF: performance regression in frame/apply (GH5654)
1 parent 5dde943 commit efb091e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3434,7 +3434,7 @@ def _apply_standard(self, func, axis, ignore_failures=False, reduce=True):
34343434

34353435
if self._is_mixed_type: # maybe a hack for now
34363436
raise AssertionError('Must be mixed type DataFrame')
3437-
values = self.values.ravel()
3437+
values = self.values
34383438
dummy = Series(NA, index=self._get_axis(axis),
34393439
dtype=values.dtype)
34403440

vb_suite/frame_methods.py

+9
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,12 @@ def f(K=100):
289289
frame_isnull = Benchmark('isnull(df)', setup,
290290
start_date=datetime(2012,1,1))
291291

292+
#----------------------------------------------------------------------
293+
# apply
294+
295+
setup = common_setup + """
296+
s = Series(np.arange(1028.))
297+
df = DataFrame({ i:s for i in range(1028) })
298+
"""
299+
frame_apply_user_func = Benchmark('df.apply(lambda x: np.corrcoef(x,s)[0,1])', setup,
300+
start_date=datetime(2012,1,1))

0 commit comments

Comments
 (0)