forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel_methods.py
28 lines (20 loc) · 1.01 KB
/
panel_methods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
#----------------------------------------------------------------------
# shift
setup = common_setup + """
index = date_range(start="2000", freq="D", periods=1000)
panel = Panel(np.random.randn(100, len(index), 1000))
"""
panel_shift = Benchmark('panel.shift(1)', setup,
start_date=datetime(2012, 1, 12))
panel_shift_minor = Benchmark('panel.shift(1, axis="minor")', setup,
start_date=datetime(2012, 1, 12))
panel_pct_change_major = Benchmark('panel.pct_change(1, axis="major")', setup,
start_date=datetime(2014, 4, 19))
panel_pct_change_minor = Benchmark('panel.pct_change(1, axis="minor")', setup,
start_date=datetime(2014, 4, 19))
panel_pct_change_items = Benchmark('panel.pct_change(1, axis="items")', setup,
start_date=datetime(2014, 4, 19))