@@ -95,8 +95,6 @@ def test_loc_getitem_int(self):
95
95
typs = ['ints' , 'uints' ], axes = 0 )
96
96
self .check_result ('int label' , 'loc' , 3 , 'ix' , 3 ,
97
97
typs = ['ints' , 'uints' ], axes = 1 )
98
- self .check_result ('int label' , 'loc' , 4 , 'ix' , 4 ,
99
- typs = ['ints' , 'uints' ], axes = 2 )
100
98
self .check_result ('int label' , 'loc' , 2 , 'ix' , 2 ,
101
99
typs = ['label' ], fails = KeyError )
102
100
@@ -137,14 +135,10 @@ def test_loc_getitem_label_list(self):
137
135
typs = ['ints' , 'uints' ], axes = 0 )
138
136
self .check_result ('list lbl' , 'loc' , [3 , 6 , 9 ], 'ix' , [3 , 6 , 9 ],
139
137
typs = ['ints' , 'uints' ], axes = 1 )
140
- self .check_result ('list lbl' , 'loc' , [4 , 8 , 12 ], 'ix' , [4 , 8 , 12 ],
141
- typs = ['ints' , 'uints' ], axes = 2 )
142
138
self .check_result ('list lbl' , 'loc' , ['a' , 'b' , 'd' ], 'ix' ,
143
139
['a' , 'b' , 'd' ], typs = ['labels' ], axes = 0 )
144
140
self .check_result ('list lbl' , 'loc' , ['A' , 'B' , 'C' ], 'ix' ,
145
141
['A' , 'B' , 'C' ], typs = ['labels' ], axes = 1 )
146
- self .check_result ('list lbl' , 'loc' , ['Z' , 'Y' , 'W' ], 'ix' ,
147
- ['Z' , 'Y' , 'W' ], typs = ['labels' ], axes = 2 )
148
142
self .check_result ('list lbl' , 'loc' , [2 , 8 , 'null' ], 'ix' ,
149
143
[2 , 8 , 'null' ], typs = ['mixed' ], axes = 0 )
150
144
self .check_result ('list lbl' , 'loc' ,
@@ -167,11 +161,6 @@ def test_loc_getitem_label_list_with_missing(self):
167
161
typs = ['ints' , 'uints' , 'floats' ],
168
162
axes = 1 , fails = KeyError )
169
163
170
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
171
- self .check_result ('list lbl' , 'loc' , [4 , 8 , 10 ], 'ix' , [4 , 8 , 10 ],
172
- typs = ['ints' , 'uints' , 'floats' ],
173
- axes = 2 , fails = KeyError )
174
-
175
164
# GH 17758 - MultiIndex and missing keys
176
165
with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
177
166
self .check_result ('list lbl' , 'loc' , [(1 , 3 ), (1 , 4 ), (2 , 5 )],
@@ -194,17 +183,13 @@ def test_loc_getitem_label_list_fails(self):
194
183
# fails
195
184
self .check_result ('list lbl' , 'loc' , [20 , 30 , 40 ], 'ix' , [20 , 30 , 40 ],
196
185
typs = ['ints' , 'uints' ], axes = 1 , fails = KeyError )
197
- self .check_result ('list lbl' , 'loc' , [20 , 30 , 40 ], 'ix' , [20 , 30 , 40 ],
198
- typs = ['ints' , 'uints' ], axes = 2 , fails = KeyError )
199
186
200
187
def test_loc_getitem_label_array_like (self ):
201
188
# array like
202
189
self .check_result ('array like' , 'loc' , Series (index = [0 , 2 , 4 ]).index ,
203
190
'ix' , [0 , 2 , 4 ], typs = ['ints' , 'uints' ], axes = 0 )
204
191
self .check_result ('array like' , 'loc' , Series (index = [3 , 6 , 9 ]).index ,
205
192
'ix' , [3 , 6 , 9 ], typs = ['ints' , 'uints' ], axes = 1 )
206
- self .check_result ('array like' , 'loc' , Series (index = [4 , 8 , 12 ]).index ,
207
- 'ix' , [4 , 8 , 12 ], typs = ['ints' , 'uints' ], axes = 2 )
208
193
209
194
def test_loc_getitem_bool (self ):
210
195
# boolean indexers
@@ -222,8 +207,6 @@ def test_loc_getitem_int_slice(self):
222
207
typs = ['ints' , 'uints' ], axes = 0 )
223
208
self .check_result ('int slice2' , 'loc' , slice (3 , 6 ), 'ix' , [3 , 6 ],
224
209
typs = ['ints' , 'uints' ], axes = 1 )
225
- self .check_result ('int slice2' , 'loc' , slice (4 , 8 ), 'ix' , [4 , 8 ],
226
- typs = ['ints' , 'uints' ], axes = 2 )
227
210
228
211
def test_loc_to_fail (self ):
229
212
@@ -318,18 +301,13 @@ def test_loc_getitem_label_slice(self):
318
301
'ix' , slice ('a' , 'c' ), typs = ['labels' ], axes = 0 )
319
302
self .check_result ('lab slice' , 'loc' , slice ('A' , 'C' ),
320
303
'ix' , slice ('A' , 'C' ), typs = ['labels' ], axes = 1 )
321
- self .check_result ('lab slice' , 'loc' , slice ('W' , 'Z' ),
322
- 'ix' , slice ('W' , 'Z' ), typs = ['labels' ], axes = 2 )
323
304
324
305
self .check_result ('ts slice' , 'loc' , slice ('20130102' , '20130104' ),
325
306
'ix' , slice ('20130102' , '20130104' ),
326
307
typs = ['ts' ], axes = 0 )
327
308
self .check_result ('ts slice' , 'loc' , slice ('20130102' , '20130104' ),
328
309
'ix' , slice ('20130102' , '20130104' ),
329
310
typs = ['ts' ], axes = 1 , fails = TypeError )
330
- self .check_result ('ts slice' , 'loc' , slice ('20130102' , '20130104' ),
331
- 'ix' , slice ('20130102' , '20130104' ),
332
- typs = ['ts' ], axes = 2 , fails = TypeError )
333
311
334
312
# GH 14316
335
313
self .check_result ('ts slice rev' , 'loc' , slice ('20130104' , '20130102' ),
@@ -339,8 +317,6 @@ def test_loc_getitem_label_slice(self):
339
317
typs = ['mixed' ], axes = 0 , fails = TypeError )
340
318
self .check_result ('mixed slice' , 'loc' , slice (2 , 8 ), 'ix' , slice (2 , 8 ),
341
319
typs = ['mixed' ], axes = 1 , fails = KeyError )
342
- self .check_result ('mixed slice' , 'loc' , slice (2 , 8 ), 'ix' , slice (2 , 8 ),
343
- typs = ['mixed' ], axes = 2 , fails = KeyError )
344
320
345
321
self .check_result ('mixed slice' , 'loc' , slice (2 , 4 , 2 ), 'ix' , slice (
346
322
2 , 4 , 2 ), typs = ['mixed' ], axes = 0 , fails = TypeError )
0 commit comments