|
1 | 1 | from .pandas_vb_common import *
|
2 | 2 |
|
3 | 3 |
|
4 |
| -class frame_constructor_ndarray(object): |
| 4 | +class Constructors(object): |
5 | 5 | goal_time = 0.2
|
6 | 6 |
|
7 | 7 | def setup(self):
|
8 | 8 | self.arr = np.random.randn(100, 100)
|
| 9 | + self.arr_str = np.array(['foo', 'bar', 'baz'], dtype=object) |
9 | 10 |
|
10 |
| - def time_frame_constructor_ndarray(self): |
11 |
| - DataFrame(self.arr) |
12 |
| - |
13 |
| - |
14 |
| -class ctor_index_array_string(object): |
15 |
| - goal_time = 0.2 |
16 |
| - |
17 |
| - def setup(self): |
18 |
| - self.data = np.array(['foo', 'bar', 'baz'], dtype=object) |
19 |
| - |
20 |
| - def time_ctor_index_array_string(self): |
21 |
| - Index(self.data) |
22 |
| - |
23 |
| - |
24 |
| -class series_constructor_ndarray(object): |
25 |
| - goal_time = 0.2 |
26 |
| - |
27 |
| - def setup(self): |
28 | 11 | self.data = np.random.randn(100)
|
29 | 12 | self.index = Index(np.arange(100))
|
30 | 13 |
|
31 |
| - def time_series_constructor_ndarray(self): |
32 |
| - Series(self.data, index=self.index) |
| 14 | + self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), |
| 15 | + Timestamp('20130101')] * 1000)) |
33 | 16 |
|
| 17 | + def time_frame_from_ndarray(self): |
| 18 | + DataFrame(self.arr) |
34 | 19 |
|
35 |
| -class dtindex_from_series_ctor(object): |
36 |
| - goal_time = 0.2 |
| 20 | + def time_series_from_ndarray(self): |
| 21 | + pd.Series(self.data, index=self.index) |
37 | 22 |
|
38 |
| - def setup(self): |
39 |
| - self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000)) |
| 23 | + def time_index_from_array_string(self): |
| 24 | + Index(self.arr_str) |
40 | 25 |
|
41 |
| - def time_dtindex_from_series_ctor(self): |
| 26 | + def time_dtindex_from_series(self): |
42 | 27 | DatetimeIndex(self.s)
|
43 | 28 |
|
44 |
| - |
45 |
| -class index_from_series_ctor(object): |
46 |
| - goal_time = 0.2 |
47 |
| - |
48 |
| - def setup(self): |
49 |
| - self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000)) |
50 |
| - |
51 |
| - def time_index_from_series_ctor(self): |
| 29 | + def time_dtindex_from_series2(self): |
52 | 30 | Index(self.s)
|
0 commit comments