forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctors.py
52 lines (32 loc) · 1.2 KB
/
ctors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from .pandas_vb_common import *
class frame_constructor_ndarray(object):
goal_time = 0.2
def setup(self):
self.arr = np.random.randn(100, 100)
def time_frame_constructor_ndarray(self):
DataFrame(self.arr)
class ctor_index_array_string(object):
goal_time = 0.2
def setup(self):
self.data = np.array(['foo', 'bar', 'baz'], dtype=object)
def time_ctor_index_array_string(self):
Index(self.data)
class series_constructor_ndarray(object):
goal_time = 0.2
def setup(self):
self.data = np.random.randn(100)
self.index = Index(np.arange(100))
def time_series_constructor_ndarray(self):
Series(self.data, index=self.index)
class dtindex_from_series_ctor(object):
goal_time = 0.2
def setup(self):
self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000))
def time_dtindex_from_series_ctor(self):
DatetimeIndex(self.s)
class index_from_series_ctor(object):
goal_time = 0.2
def setup(self):
self.s = Series(([Timestamp('20110101'), Timestamp('20120101'), Timestamp('20130101')] * 1000))
def time_index_from_series_ctor(self):
Index(self.s)