Vbench performance benchmarks for pandas

frame_methods

frame_fillna_inplace

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(10000, 100))
df.values[::2] = np.nan

Benchmark statement

df.fillna(0, inplace=True)

Performance graph

_images/frame_fillna_inplace.png

frame_reindex_both_axes_ix

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(1000, 1000))
idx = range(400, 700)

Benchmark statement

df.ix[idx, idx]

Performance graph

_images/frame_reindex_both_axes_ix.png

frame_reindex_axis0

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(1000, 1000))
idx = range(400, 700)

Benchmark statement

df.reindex(idx)

Performance graph

_images/frame_reindex_axis0.png

frame_boolean_row_select

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(10000, 100))
bool_arr = np.zeros(10000, dtype=bool)
bool_arr[:1000] = True

Benchmark statement

df[bool_arr]

Performance graph

_images/frame_boolean_row_select.png

frame_reindex_both_axes

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(1000, 1000))
idx = range(400, 700)

Benchmark statement

df.reindex(index=idx, columns=idx)

Performance graph

_images/frame_reindex_both_axes.png

frame_fancy_lookup

Benchmark setup

from pandas_vb_common import *

df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'

row_labels = list(df.index[::10])[:900]
col_labels = list(df.columns) * 100
row_labels_all = list(df.index) * len(df.columns)
col_labels_all = list(df.columns) * len(df.index)

Benchmark statement

df.lookup(row_labels, col_labels)

Performance graph

_images/frame_fancy_lookup.png

frame_reindex_axis1

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(1000, 1000))
idx = range(400, 700)

Benchmark statement

df.reindex(columns=idx)

Performance graph

_images/frame_reindex_axis1.png

frame_fancy_lookup_all

Benchmark setup

from pandas_vb_common import *

df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'

row_labels = list(df.index[::10])[:900]
col_labels = list(df.columns) * 100
row_labels_all = list(df.index) * len(df.columns)
col_labels_all = list(df.columns) * len(df.index)

Benchmark statement

df.lookup(row_labels_all, col_labels_all)

Performance graph

_images/frame_fancy_lookup_all.png