forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctors.py
31 lines (23 loc) · 769 Bytes
/
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
from vbench.benchmark import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
#----------------------------------------------------------------------
# Series constructors
setup = common_setup + """
data = np.random.randn(100)
index = Index(np.arange(100))
"""
ctor_series_ndarray = \
Benchmark("Series(data, index=index)", setup=setup,
name='series_constructor_ndarray')
setup = common_setup + """
arr = np.random.randn(100, 100)
"""
ctor_frame_ndarray = \
Benchmark("DataFrame(arr)", setup=setup,
name='frame_constructor_ndarray')
setup = common_setup + """
data = np.array(['foo', 'bar', 'baz'], dtype=object)
"""
ctor_index_array_string = Benchmark('Index(data)', setup=setup)