Skip to content

Commit 6164da2

Browse files
mroeschkejorisvandenbossche
authored andcommitted
CLN: ASV panel_methods (#18907)
1 parent eccafcc commit 6164da2

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

asv_bench/benchmarks/panel_methods.py

+12-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
from .pandas_vb_common import *
1+
import numpy as np
22

3+
from .pandas_vb_common import Panel, setup # noqa
34

4-
class PanelMethods(object):
5-
goal_time = 0.2
6-
7-
def setup(self):
8-
self.index = date_range(start='2000', freq='D', periods=1000)
9-
self.panel = Panel(np.random.randn(100, len(self.index), 1000))
105

11-
def time_pct_change_items(self):
12-
self.panel.pct_change(1, axis='items')
6+
class PanelMethods(object):
137

14-
def time_pct_change_major(self):
15-
self.panel.pct_change(1, axis='major')
8+
goal_time = 0.2
9+
params = ['items', 'major', 'minor']
10+
param_names = ['axis']
1611

17-
def time_pct_change_minor(self):
18-
self.panel.pct_change(1, axis='minor')
12+
def setup(self, axis):
13+
self.panel = Panel(np.random.randn(100, 1000, 100))
1914

20-
def time_shift(self):
21-
self.panel.shift(1)
15+
def time_pct_change(self, axis):
16+
self.panel.pct_change(1, axis=axis)
2217

23-
def time_shift_minor(self):
24-
self.panel.shift(1, axis='minor')
18+
def time_shift(self, axis):
19+
self.panel.shift(1, axis=axis)

0 commit comments

Comments
 (0)