Vbench performance benchmarks for pandas

reshape

reshape_stack_simple

Benchmark setup

from pandas_vb_common import *
index = MultiIndex.from_arrays([np.arange(100).repeat(100),
                               np.roll(np.tile(np.arange(100), 100), 25)])
df = DataFrame(np.random.randn(10000, 4), index=index)

udf = df.unstack(1)

Benchmark statement

udf.stack()

Performance graph

_images/reshape_stack_simple.png

reshape_unstack_simple

Benchmark setup

from pandas_vb_common import *
index = MultiIndex.from_arrays([np.arange(100).repeat(100),
                               np.roll(np.tile(np.arange(100), 100), 25)])
df = DataFrame(np.random.randn(10000, 4), index=index)

Benchmark statement

df.unstack(1)

Performance graph

_images/reshape_unstack_simple.png