44from .pandas_vb_common import setup # noqa
55
66
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 ):
831
932 goal_time = 0.2
1033
@@ -19,12 +42,6 @@ def setup(self):
1942 self .s = Series ([Timestamp ('20110101' ), Timestamp ('20120101' ),
2043 Timestamp ('20130101' )] * N * 10 )
2144
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-
2845 def time_index_from_array_string (self ):
2946 Index (self .arr_str )
3047
0 commit comments