|
1 |
| -from .pandas_vb_common import * |
| 1 | +import numpy as np |
| 2 | +from pandas import DataFrame, Series, Index, DatetimeIndex, Timestamp |
2 | 3 |
|
3 | 4 |
|
4 | 5 | class Constructors(object):
|
| 6 | + |
5 | 7 | goal_time = 0.2
|
6 | 8 |
|
7 | 9 | def setup(self):
|
8 |
| - self.arr = np.random.randn(100, 100) |
| 10 | + N = 10**2 |
| 11 | + np.random.seed(1234) |
| 12 | + self.arr = np.random.randn(N, N) |
9 | 13 | self.arr_str = np.array(['foo', 'bar', 'baz'], dtype=object)
|
10 | 14 |
|
11 |
| - self.data = np.random.randn(100) |
12 |
| - self.index = Index(np.arange(100)) |
| 15 | + self.data = np.random.randn(N) |
| 16 | + self.index = Index(np.arange(N)) |
13 | 17 |
|
14 |
| - self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), |
15 |
| - Timestamp('20130101')] * 1000)) |
| 18 | + self.s = Series([Timestamp('20110101'), Timestamp('20120101'), |
| 19 | + Timestamp('20130101')] * N * 10) |
16 | 20 |
|
17 | 21 | def time_frame_from_ndarray(self):
|
18 | 22 | DataFrame(self.arr)
|
19 | 23 |
|
20 | 24 | def time_series_from_ndarray(self):
|
21 |
| - pd.Series(self.data, index=self.index) |
| 25 | + Series(self.data, index=self.index) |
22 | 26 |
|
23 | 27 | def time_index_from_array_string(self):
|
24 | 28 | Index(self.arr_str)
|
25 | 29 |
|
26 | 30 | def time_dtindex_from_series(self):
|
27 | 31 | DatetimeIndex(self.s)
|
28 | 32 |
|
29 |
| - def time_dtindex_from_series2(self): |
| 33 | + def time_dtindex_from_index_with_series(self): |
30 | 34 | Index(self.s)
|
0 commit comments