Skip to content

Commit 3a4e770

Browse files
committed
PRF: Fixed shift speed tests and added consolidated DataFrame shift perf
test
1 parent 5cab310 commit 3a4e770

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

vb_suite/frame_methods.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def test_equal(name):
386386
def test_unequal(name):
387387
df, df2 = pairs[name]
388388
return df.equals(df2)
389-
389+
390390
float_df = DataFrame(np.random.randn(1000, 1000))
391391
object_df = DataFrame([['foo']*1000]*1000)
392392
nonunique_cols = object_df.copy()
@@ -434,11 +434,21 @@ def test_unequal(name):
434434
# frame shift speedup issue-5609
435435

436436
setup = common_setup + """
437-
df = pd.DataFrame(np.random.rand(10000,500))
437+
df = DataFrame(np.random.rand(10000,500))
438+
# note: df._data.blocks are f_contigous
438439
"""
439440
frame_shift_axis0 = Benchmark('df.shift(1,axis=0)', setup,
440-
name = 'frame_shift_axis_0',
441441
start_date=datetime(2014,1,1))
442442
frame_shift_axis1 = Benchmark('df.shift(1,axis=1)', setup,
443-
name = 'frame_shift_axis_1',
444-
start_date=datetime(2014,1,1))
443+
start_date=datetime(2014,1,1))
444+
445+
#
446+
setup = common_setup + """
447+
df = DataFrame(np.random.rand(10000,500))
448+
df = df.consolidate()
449+
# note: df._data.blocks are c_contigous
450+
"""
451+
frame_shift_c_order_axis0 = Benchmark('df.shift(1,axis=0)', setup,
452+
start_date=datetime(2014,1,1))
453+
frame_shift_c_order_axis1 = Benchmark('df.shift(1,axis=1)', setup,
454+
start_date=datetime(2014,1,1))

0 commit comments

Comments
 (0)