4
4
from .pandas_vb_common import setup # noqa
5
5
6
6
7
- class Constructors (object ):
7
+ class SeriesConstructors (object ):
8
+
9
+ goal_time = 0.2
10
+
11
+ param_names = ["data_fmt" , "with_index" ]
12
+ params = [[lambda x : x ,
13
+ list ,
14
+ lambda arr : dict (zip (range (len (arr )), arr )),
15
+ lambda arr : [[i , - i ] for i in arr ],
16
+ lambda arr : ([[i , - i ] for i in arr ][:- 1 ] + [None ])],
17
+ [False , True ]]
18
+
19
+ def setup (self , data_fmt , with_index ):
20
+ N = 10 ** 2
21
+ np .random .seed (1234 )
22
+ arr = np .random .randn (N )
23
+ self .data = data_fmt (arr )
24
+ self .index = np .arange (N ) if with_index else None
25
+
26
+ def time_series_constructor (self , data_fmt , with_index ):
27
+ Series (self .data , index = self .index )
28
+
29
+
30
+ class SeriesDtypesConstructors (object ):
8
31
9
32
goal_time = 0.2
10
33
@@ -19,12 +42,6 @@ def setup(self):
19
42
self .s = Series ([Timestamp ('20110101' ), Timestamp ('20120101' ),
20
43
Timestamp ('20130101' )] * N * 10 )
21
44
22
- def time_frame_from_ndarray (self ):
23
- DataFrame (self .arr )
24
-
25
- def time_series_from_ndarray (self ):
26
- Series (self .data , index = self .index )
27
-
28
45
def time_index_from_array_string (self ):
29
46
Index (self .arr_str )
30
47
0 commit comments