|
1 | 1 | import numpy as np
|
2 | 2 | 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) |
5 | 5 | from .pandas_vb_common import lib
|
6 | 6 |
|
7 | 7 |
|
@@ -35,15 +35,15 @@ def time_reindex_multiindex(self):
|
35 | 35 |
|
36 | 36 | class ReindexMethod(object):
|
37 | 37 |
|
38 |
| - params = ['pad', 'backfill'] |
39 |
| - param_names = ['method'] |
| 38 | + params = [['pad', 'backfill'], [date_range, period_range]] |
| 39 | + param_names = ['method', 'constructor'] |
40 | 40 |
|
41 |
| - def setup(self, method): |
| 41 | + def setup(self, method, constructor): |
42 | 42 | 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') |
44 | 44 | self.ts = Series(np.random.randn(N), index=self.idx)[::2]
|
45 | 45 |
|
46 |
| - def time_reindex_method(self, method): |
| 46 | + def time_reindex_method(self, method, constructor): |
47 | 47 | self.ts.reindex(self.idx, method=method)
|
48 | 48 |
|
49 | 49 |
|
|
0 commit comments