@@ -438,7 +438,6 @@ def test_timestamp_multiindex_indexer():
438
438
)
439
439
should_be = pd .Series (data = np .arange (24 , len (qidx ) + 24 ), index = qidx , name = "foo" )
440
440
tm .assert_series_equal (result , should_be )
441
- < << << << HEAD
442
441
443
442
444
443
def test_get_loc_with_values_including_missing_values ():
@@ -527,37 +526,3 @@ def test_slice_locs_with_missing_value(index_arr, expected, start_idx, end_idx):
527
526
idx = MultiIndex .from_arrays (index_arr )
528
527
result = idx .slice_locs (start = start_idx , end = end_idx )
529
528
assert result == expected
530
-
531
-
532
- def test_multiindex_loc_order ():
533
- # GH 22797
534
- # Try to respect order of keys given for MultiIndex.loc
535
- df = pd .DataFrame (
536
- np .arange (12 ).reshape ((4 , 3 )),
537
- index = [["a" , "a" , "b" , "b" ], [1 , 2 , 1 , 2 ]],
538
- columns = [["Ohio" , "Ohio" , "Colorado" ], ["Green" , "Red" , "Green" ]],
539
- )
540
-
541
- res = df .loc [["b" , "a" ], :]
542
- exp_index = pd .MultiIndex .from_arrays ([["b" , "b" , "a" , "a" ], [1 , 2 , 1 , 2 ]])
543
- tm .assert_index_equal (res .index , exp_index )
544
-
545
- res = df .loc [["a" , "b" ], :]
546
- exp_index = pd .MultiIndex .from_arrays ([["a" , "a" , "b" , "b" ], [1 , 2 , 1 , 2 ]])
547
- tm .assert_index_equal (res .index , exp_index )
548
-
549
- res = df .loc [(["a" , "b" ], [1 , 2 ]), :]
550
- exp_index = pd .MultiIndex .from_arrays ([["a" , "a" , "b" , "b" ], [1 , 2 , 1 , 2 ]])
551
- tm .assert_index_equal (res .index , exp_index )
552
-
553
- res = df .loc [(["a" , "b" ], [2 , 1 ]), :]
554
- exp_index = pd .MultiIndex .from_arrays ([["a" , "a" , "b" , "b" ], [2 , 1 , 2 , 1 ]])
555
- tm .assert_index_equal (res .index , exp_index )
556
-
557
- res = df .loc [(["b" , "a" ], [2 , 1 ]), :]
558
- exp_index = pd .MultiIndex .from_arrays ([["b" , "b" , "a" , "a" ], [2 , 1 , 2 , 1 ]])
559
- tm .assert_index_equal (res .index , exp_index )
560
-
561
- res = df .loc [(["b" , "a" ], [1 , 2 ]), :]
562
- exp_index = pd .MultiIndex .from_arrays ([["b" , "b" , "a" , "a" ], [1 , 2 , 1 , 2 ]])
563
- tm .assert_index_equal (res .index , exp_index )
0 commit comments