Skip to content

Commit 66146ec

Browse files
committed
PERF: benchmark PeriodIndex pad/backfill
1 parent d2143f1 commit 66146ec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

asv_bench/benchmarks/reindex.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pandas.util.testing as tm
3-
from pandas import (DataFrame, Series, MultiIndex, Index,
4-
date_range)
3+
from pandas import (DataFrame, Series, MultiIndex, Index, date_range,
4+
period_range)
55
from .pandas_vb_common import lib
66

77

@@ -35,15 +35,15 @@ def time_reindex_multiindex(self):
3535

3636
class ReindexMethod(object):
3737

38-
params = ['pad', 'backfill']
39-
param_names = ['method']
38+
params = [['pad', 'backfill'], [date_range, period_range]]
39+
param_names = ['method', 'constructor']
4040

41-
def setup(self, method):
41+
def setup(self, method, constructor):
4242
N = 100000
43-
self.idx = date_range('1/1/2000', periods=N, freq='1min')
43+
self.idx = constructor('1/1/2000', periods=N, freq='1min')
4444
self.ts = Series(np.random.randn(N), index=self.idx)[::2]
4545

46-
def time_reindex_method(self, method):
46+
def time_reindex_method(self, method, constructor):
4747
self.ts.reindex(self.idx, method=method)
4848

4949

0 commit comments

Comments
 (0)