@@ -19,9 +19,9 @@ def remove(f):
19
19
# get from a store
20
20
21
21
setup1 = common_setup + """
22
- index = [rands(10) for _ in xrange(100000 )]
23
- df = DataFrame({'float1' : randn(100000 ),
24
- 'float2' : randn(100000 )},
22
+ index = [rands(10) for _ in xrange(25000 )]
23
+ df = DataFrame({'float1' : randn(25000 ),
24
+ 'float2' : randn(25000 )},
25
25
index=index)
26
26
remove(f)
27
27
store = HDFStore(f)
@@ -36,9 +36,9 @@ def remove(f):
36
36
# write to a store
37
37
38
38
setup2 = common_setup + """
39
- index = [rands(10) for _ in xrange(100000 )]
40
- df = DataFrame({'float1' : randn(100000 ),
41
- 'float2' : randn(100000 )},
39
+ index = [rands(10) for _ in xrange(25000 )]
40
+ df = DataFrame({'float1' : randn(25000 ),
41
+ 'float2' : randn(25000 )},
42
42
index=index)
43
43
remove(f)
44
44
store = HDFStore(f)
@@ -52,12 +52,12 @@ def remove(f):
52
52
# get from a store (mixed)
53
53
54
54
setup3 = common_setup + """
55
- index = [rands(10) for _ in xrange(100000 )]
56
- df = DataFrame({'float1' : randn(100000 ),
57
- 'float2' : randn(100000 ),
58
- 'string1' : ['foo'] * 100000 ,
59
- 'bool1' : [True] * 100000 ,
60
- 'int1' : np.random.randint(0, 1000000 , size=100000 )},
55
+ index = [rands(10) for _ in xrange(25000 )]
56
+ df = DataFrame({'float1' : randn(25000 ),
57
+ 'float2' : randn(25000 ),
58
+ 'string1' : ['foo'] * 25000 ,
59
+ 'bool1' : [True] * 25000 ,
60
+ 'int1' : np.random.randint(0, 250000 , size=25000 )},
61
61
index=index)
62
62
remove(f)
63
63
store = HDFStore(f)
@@ -73,12 +73,12 @@ def remove(f):
73
73
# write to a store (mixed)
74
74
75
75
setup4 = common_setup + """
76
- index = [rands(10) for _ in xrange(100000 )]
77
- df = DataFrame({'float1' : randn(100000 ),
78
- 'float2' : randn(100000 ),
79
- 'string1' : ['foo'] * 100000 ,
80
- 'bool1' : [True] * 100000 ,
81
- 'int1' : np.random.randint(0, 1000000 , size=100000 )},
76
+ index = [rands(10) for _ in xrange(25000 )]
77
+ df = DataFrame({'float1' : randn(25000 ),
78
+ 'float2' : randn(25000 ),
79
+ 'string1' : ['foo'] * 25000 ,
80
+ 'bool1' : [True] * 25000 ,
81
+ 'int1' : np.random.randint(0, 250000 , size=25000 )},
82
82
index=index)
83
83
remove(f)
84
84
store = HDFStore(f)
@@ -92,12 +92,12 @@ def remove(f):
92
92
# get from a table (mixed)
93
93
94
94
setup5 = common_setup + """
95
- index = [rands(10) for _ in xrange(100000 )]
96
- df = DataFrame({'float1' : randn(100000 ),
97
- 'float2' : randn(100000 ),
98
- 'string1' : ['foo'] * 100000 ,
99
- 'bool1' : [True] * 100000 ,
100
- 'int1' : np.random.randint(0, 1000000 , size=100000 )},
95
+ index = [rands(10) for _ in xrange(25000 )]
96
+ df = DataFrame({'float1' : randn(25000 ),
97
+ 'float2' : randn(25000 ),
98
+ 'string1' : ['foo'] * 25000 ,
99
+ 'bool1' : [True] * 25000 ,
100
+ 'int1' : np.random.randint(0, 250000 , size=25000 )},
101
101
index=index)
102
102
103
103
remove(f)
@@ -114,12 +114,12 @@ def remove(f):
114
114
# write to a table (mixed)
115
115
116
116
setup6 = common_setup + """
117
- index = [rands(10) for _ in xrange(100000 )]
118
- df = DataFrame({'float1' : randn(100000 ),
119
- 'float2' : randn(100000 ),
120
- 'string1' : ['foo'] * 100000 ,
121
- 'bool1' : [True] * 100000 ,
122
- 'int1' : np.random.randint(0, 100000 , size=100000 )},
117
+ index = [rands(10) for _ in xrange(25000 )]
118
+ df = DataFrame({'float1' : randn(25000 ),
119
+ 'float2' : randn(25000 ),
120
+ 'string1' : ['foo'] * 25000 ,
121
+ 'bool1' : [True] * 25000 ,
122
+ 'int1' : np.random.randint(0, 25000 , size=25000 )},
123
123
index=index)
124
124
remove(f)
125
125
store = HDFStore(f)
@@ -133,9 +133,9 @@ def remove(f):
133
133
# select from a table
134
134
135
135
setup7 = common_setup + """
136
- index = [rands(10) for _ in xrange(100000 )]
137
- df = DataFrame({'float1' : randn(100000 ),
138
- 'float2' : randn(100000 ) },
136
+ index = [rands(10) for _ in xrange(25000 )]
137
+ df = DataFrame({'float1' : randn(25000 ),
138
+ 'float2' : randn(25000 ) },
139
139
index=index)
140
140
141
141
remove(f)
@@ -152,9 +152,9 @@ def remove(f):
152
152
# write to a table
153
153
154
154
setup8 = common_setup + """
155
- index = [rands(10) for _ in xrange(100000 )]
156
- df = DataFrame({'float1' : randn(100000 ),
157
- 'float2' : randn(100000 ) },
155
+ index = [rands(10) for _ in xrange(25000 )]
156
+ df = DataFrame({'float1' : randn(25000 ),
157
+ 'float2' : randn(25000 ) },
158
158
index=index)
159
159
remove(f)
160
160
store = HDFStore(f)
@@ -168,7 +168,7 @@ def remove(f):
168
168
# get from a table (wide)
169
169
170
170
setup9 = common_setup + """
171
- df = DataFrame(np.random.randn(100000,200 ))
171
+ df = DataFrame(np.random.randn(25000,100 ))
172
172
173
173
remove(f)
174
174
store = HDFStore(f)
@@ -184,7 +184,7 @@ def remove(f):
184
184
# write to a table (wide)
185
185
186
186
setup10 = common_setup + """
187
- df = DataFrame(np.random.randn(100000,200 ))
187
+ df = DataFrame(np.random.randn(25000,100 ))
188
188
189
189
remove(f)
190
190
store = HDFStore(f)
@@ -195,16 +195,15 @@ def remove(f):
195
195
start_date = start_date )
196
196
197
197
#----------------------------------------------------------------------
198
- # get from a table (wide) (indexed)
198
+ # get from a table (wide)
199
199
200
200
setup11 = common_setup + """
201
- index = date_range('1/1/2000', periods = 100000 )
202
- df = DataFrame(np.random.randn(100000,200 ), index = index)
201
+ index = date_range('1/1/2000', periods = 25000 )
202
+ df = DataFrame(np.random.randn(25000,100 ), index = index)
203
203
204
204
remove(f)
205
205
store = HDFStore(f)
206
206
store.append('df11',df)
207
- store.create_table_index('df11')
208
207
"""
209
208
210
209
query_store_table_wide = Benchmark (
@@ -213,18 +212,17 @@ def remove(f):
213
212
214
213
215
214
#----------------------------------------------------------------------
216
- # query from a table (indexed)
215
+ # query from a table
217
216
218
217
setup12 = common_setup + """
219
- index = date_range('1/1/2000', periods = 100000 )
220
- df = DataFrame({'float1' : randn(100000 ),
221
- 'float2' : randn(100000 ) },
218
+ index = date_range('1/1/2000', periods = 25000 )
219
+ df = DataFrame({'float1' : randn(25000 ),
220
+ 'float2' : randn(25000 ) },
222
221
index=index)
223
222
224
223
remove(f)
225
224
store = HDFStore(f)
226
225
store.append('df12',df)
227
- store.create_table_index('df12')
228
226
"""
229
227
230
228
query_store_table = Benchmark (
@@ -235,8 +233,8 @@ def remove(f):
235
233
# select from a panel table
236
234
237
235
setup13 = common_setup + """
238
- p = Panel(randn(20, 1000, 1000 ), items= [ 'Item%03d' % i for i in xrange(20) ],
239
- major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(1000 ) ])
236
+ p = Panel(randn(20, 1000, 25 ), items= [ 'Item%03d' % i for i in xrange(20) ],
237
+ major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(25 ) ])
240
238
241
239
remove(f)
242
240
store = HDFStore(f)
@@ -252,8 +250,8 @@ def remove(f):
252
250
# write to a panel table
253
251
254
252
setup14 = common_setup + """
255
- p = Panel(randn(20, 1000, 1000 ), items= [ 'Item%03d' % i for i in xrange(20) ],
256
- major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(1000 ) ])
253
+ p = Panel(randn(20, 1000, 25 ), items= [ 'Item%03d' % i for i in xrange(20) ],
254
+ major_axis=date_range('1/1/2000', periods=1000), minor_axis = [ 'E%03d' % i for i in xrange(25 ) ])
257
255
258
256
remove(f)
259
257
store = HDFStore(f)
@@ -262,3 +260,18 @@ def remove(f):
262
260
write_store_table_panel = Benchmark (
263
261
"store.append('p2',p)" , setup14 , cleanup = "store.close()" ,
264
262
start_date = start_date )
263
+
264
+ #----------------------------------------------------------------------
265
+ # write to a table (data_columns)
266
+
267
+ setup15 = common_setup + """
268
+ df = DataFrame(np.random.randn(25000,10),columns = [ 'C%03d' % i for i in xrange(10) ])
269
+
270
+ remove(f)
271
+ store = HDFStore(f)
272
+ """
273
+
274
+ write_store_table_dc = Benchmark (
275
+ "store.append('df15',df,data_columns=True)" , setup15 , cleanup = "store.close()" ,
276
+ start_date = start_date )
277
+
0 commit comments