Vbench performance benchmarks for pandas

frame_ctor

series_ctor_from_dict

Benchmark setup

from pandas_vb_common import *

N, K = 5000, 50
index = [rands(10) for _ in xrange(N)]
columns = [rands(10) for _ in xrange(K)]
frame = DataFrame(np.random.randn(N, K), index=index, columns=columns)

try:
    data = frame.to_dict()
except:
    data = frame.toDict()

some_dict = data.values()[0]
dict_list = [dict(zip(columns, row)) for row in frame.values]

Benchmark statement

Series(some_dict)

Performance graph

_images/series_ctor_from_dict.png

frame_get_numeric_data

Benchmark setup

from pandas_vb_common import *

df = DataFrame(randn(10000, 25))
df['foo'] = 'bar'
df['bar'] = 'baz'
df = df.consolidate()

Benchmark statement

df._get_numeric_data()

Performance graph

_images/frame_get_numeric_data.png

frame_ctor_nested_dict_int64

Benchmark setup

from pandas_vb_common import *

data = dict((i,dict((j,float(j)) for j in xrange(100))) for i in xrange(2000))

Benchmark statement

DataFrame(data)

Performance graph

_images/frame_ctor_nested_dict_int64.png

frame_ctor_nested_dict

Benchmark setup

from pandas_vb_common import *

N, K = 5000, 50
index = [rands(10) for _ in xrange(N)]
columns = [rands(10) for _ in xrange(K)]
frame = DataFrame(np.random.randn(N, K), index=index, columns=columns)

try:
    data = frame.to_dict()
except:
    data = frame.toDict()

some_dict = data.values()[0]
dict_list = [dict(zip(columns, row)) for row in frame.values]

Benchmark statement

DataFrame(data)

Performance graph

_images/frame_ctor_nested_dict.png

frame_ctor_list_of_dict

Benchmark setup

from pandas_vb_common import *

N, K = 5000, 50
index = [rands(10) for _ in xrange(N)]
columns = [rands(10) for _ in xrange(K)]
frame = DataFrame(np.random.randn(N, K), index=index, columns=columns)

try:
    data = frame.to_dict()
except:
    data = frame.toDict()

some_dict = data.values()[0]
dict_list = [dict(zip(columns, row)) for row in frame.values]

Benchmark statement

DataFrame(dict_list)

Performance graph

_images/frame_ctor_list_of_dict.png