@@ -67,16 +67,20 @@ def time_iloc_slice(self, index, index_structure):
6767 self .data .iloc [:800000 ]
6868
6969 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 ]
7172
7273 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 ]]
7476
7577 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 ]
7780
7881 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 ]
8084
8185 def time_loc_array (self , index , index_structure ):
8286 self .data .loc [self .array ]
@@ -140,7 +144,8 @@ class DataFrameStringIndexing:
140144 def setup (self ):
141145 index = tm .makeStringIndex (1000 )
142146 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 )
144149 self .idx_scalar = index [100 ]
145150 self .col_scalar = columns [10 ]
146151 self .bool_indexer = self .df [self .col_scalar ] > 0
@@ -151,7 +156,8 @@ def time_get_value(self):
151156 self .df .get_value (self .idx_scalar , self .col_scalar )
152157
153158 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 ]
155161
156162 def time_loc (self ):
157163 self .df .loc [self .idx_scalar , self .col_scalar ]
@@ -215,24 +221,27 @@ def setup(self):
215221 self .df = DataFrame (self .s )
216222
217223 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+ )
228235 self .idx = IndexSlice [20000 :30000 , 20 :30 , 35 :45 , 30000 :40000 ]
229236 self .mdt = self .mdt .set_index (["A" , "B" , "C" , "D" ]).sort_index ()
230237
231238 def time_series_ix (self ):
232- self .s .ix [999 ]
239+ with warnings .catch_warnings (record = True ):
240+ self .s .ix [999 ]
233241
234242 def time_frame_ix (self ):
235- self .df .ix [999 ]
243+ with warnings .catch_warnings (record = True ):
244+ self .df .ix [999 ]
236245
237246 def time_index_slice (self ):
238247 self .mdt .loc [self .idx , :]
@@ -309,7 +318,8 @@ def time_lookup_iloc(self, s):
309318 s .iloc
310319
311320 def time_lookup_ix (self , s ):
312- s .ix
321+ with warnings .catch_warnings (record = True ):
322+ s .ix
313323
314324 def time_lookup_loc (self , s ):
315325 s .loc
0 commit comments