@@ -67,16 +67,20 @@ def time_iloc_slice(self, index, index_structure):
67
67
self .data .iloc [:800000 ]
68
68
69
69
def time_ix_array (self , index , index_structure ):
70
- self .data .ix [self .array ]
70
+ with warnings .catch_warnings (record = True ):
71
+ self .data .ix [self .array ]
71
72
72
73
def time_ix_list_like (self , index , index_structure ):
73
- self .data .ix [[800000 ]]
74
+ with warnings .catch_warnings (record = True ):
75
+ self .data .ix [[800000 ]]
74
76
75
77
def time_ix_scalar (self , index , index_structure ):
76
- self .data .ix [800000 ]
78
+ with warnings .catch_warnings (record = True ):
79
+ self .data .ix [800000 ]
77
80
78
81
def time_ix_slice (self , index , index_structure ):
79
- self .data .ix [:800000 ]
82
+ with warnings .catch_warnings (record = True ):
83
+ self .data .ix [:800000 ]
80
84
81
85
def time_loc_array (self , index , index_structure ):
82
86
self .data .loc [self .array ]
@@ -140,7 +144,8 @@ class DataFrameStringIndexing:
140
144
def setup (self ):
141
145
index = tm .makeStringIndex (1000 )
142
146
columns = tm .makeStringIndex (30 )
143
- self .df = DataFrame (np .random .randn (1000 , 30 ), index = index , columns = columns )
147
+ with warnings .catch_warnings (record = True ):
148
+ self .df = DataFrame (np .random .randn (1000 , 30 ), index = index , columns = columns )
144
149
self .idx_scalar = index [100 ]
145
150
self .col_scalar = columns [10 ]
146
151
self .bool_indexer = self .df [self .col_scalar ] > 0
@@ -151,7 +156,8 @@ def time_get_value(self):
151
156
self .df .get_value (self .idx_scalar , self .col_scalar )
152
157
153
158
def time_ix (self ):
154
- self .df .ix [self .idx_scalar , self .col_scalar ]
159
+ with warnings .catch_warnings (record = True ):
160
+ self .df .ix [self .idx_scalar , self .col_scalar ]
155
161
156
162
def time_loc (self ):
157
163
self .df .loc [self .idx_scalar , self .col_scalar ]
@@ -215,24 +221,27 @@ def setup(self):
215
221
self .df = DataFrame (self .s )
216
222
217
223
n = 100000
218
- self .mdt = DataFrame (
219
- {
220
- "A" : np .random .choice (range (10000 , 45000 , 1000 ), n ),
221
- "B" : np .random .choice (range (10 , 400 ), n ),
222
- "C" : np .random .choice (range (1 , 150 ), n ),
223
- "D" : np .random .choice (range (10000 , 45000 ), n ),
224
- "x" : np .random .choice (range (400 ), n ),
225
- "y" : np .random .choice (range (25 ), n ),
226
- }
227
- )
224
+ with warnings .catch_warnings (record = True ):
225
+ self .mdt = DataFrame (
226
+ {
227
+ "A" : np .random .choice (range (10000 , 45000 , 1000 ), n ),
228
+ "B" : np .random .choice (range (10 , 400 ), n ),
229
+ "C" : np .random .choice (range (1 , 150 ), n ),
230
+ "D" : np .random .choice (range (10000 , 45000 ), n ),
231
+ "x" : np .random .choice (range (400 ), n ),
232
+ "y" : np .random .choice (range (25 ), n ),
233
+ }
234
+ )
228
235
self .idx = IndexSlice [20000 :30000 , 20 :30 , 35 :45 , 30000 :40000 ]
229
236
self .mdt = self .mdt .set_index (["A" , "B" , "C" , "D" ]).sort_index ()
230
237
231
238
def time_series_ix (self ):
232
- self .s .ix [999 ]
239
+ with warnings .catch_warnings (record = True ):
240
+ self .s .ix [999 ]
233
241
234
242
def time_frame_ix (self ):
235
- self .df .ix [999 ]
243
+ with warnings .catch_warnings (record = True ):
244
+ self .df .ix [999 ]
236
245
237
246
def time_index_slice (self ):
238
247
self .mdt .loc [self .idx , :]
@@ -309,7 +318,8 @@ def time_lookup_iloc(self, s):
309
318
s .iloc
310
319
311
320
def time_lookup_ix (self , s ):
312
- s .ix
321
+ with warnings .catch_warnings (record = True ):
322
+ s .ix
313
323
314
324
def time_lookup_loc (self , s ):
315
325
s .loc
0 commit comments