Vbench performance benchmarks for pandas

panel_ctor

panel_from_dict_two_different_indexes

Benchmark setup

from pandas_vb_common import *

data_frames = {}
start = datetime(1990,1,1)
end = datetime(2012,1,1)
for x in xrange(100):
   if x == 50:
       end += timedelta(days=1)
   dr = np.asarray(DateRange(start, end))
   df = DataFrame({"a": [0]*len(dr), "b": [1]*len(dr),
                   "c": [2]*len(dr)}, index=dr)
   data_frames[x] = df

Benchmark statement

Panel.from_dict(data_frames)

Performance graph

_images/panel_from_dict_two_different_indexes.png

panel_from_dict_equiv_indexes

Benchmark setup

from pandas_vb_common import *

data_frames = {}
for x in xrange(100):
   dr = np.asarray(DateRange(datetime(1990,1,1), datetime(2012,1,1)))
   df = DataFrame({"a": [0]*len(dr), "b": [1]*len(dr),
                   "c": [2]*len(dr)}, index=dr)
   data_frames[x] = df

Benchmark statement

Panel.from_dict(data_frames)

Performance graph

_images/panel_from_dict_equiv_indexes.png

panel_from_dict_same_index

Benchmark setup

from pandas_vb_common import *

# create 100 dataframes with the same index
dr = np.asarray(DateRange(datetime(1990,1,1), datetime(2012,1,1)))
data_frames = {}
for x in xrange(100):
   df = DataFrame({"a": [0]*len(dr), "b": [1]*len(dr),
                   "c": [2]*len(dr)}, index=dr)
   data_frames[x] = df

Benchmark statement

Panel.from_dict(data_frames)

Performance graph

_images/panel_from_dict_same_index.png

panel_from_dict_all_different_indexes

Benchmark setup

from pandas_vb_common import *

data_frames = {}
start = datetime(1990,1,1)
end = datetime(2012,1,1)
for x in xrange(100):
   end += timedelta(days=1)
   dr = np.asarray(DateRange(start, end))
   df = DataFrame({"a": [0]*len(dr), "b": [1]*len(dr),
                   "c": [2]*len(dr)}, index=dr)
   data_frames[x] = df

Benchmark statement

Panel.from_dict(data_frames)

Performance graph

_images/panel_from_dict_all_different_indexes.png