Skip to content

Commit f06d987

Browse files
authored
TST: adds test for .loc on multiindex for series GH43908 (#44035)
* TST: adds test for .loc on multiindex for series GH43908 * TST: refactors test_multindex_series_loc_with_tuple_label
1 parent 9e76b6e commit f06d987

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/indexing/multiindex/test_loc.py

+8
Original file line numberDiff line numberDiff line change
@@ -912,3 +912,11 @@ def test_loc_keyerror_rightmost_key_missing():
912912
df = df.set_index(["A", "B"])
913913
with pytest.raises(KeyError, match="^1$"):
914914
df.loc[(100, 1)]
915+
916+
917+
def test_multindex_series_loc_with_tuple_label():
918+
# GH#43908
919+
mi = MultiIndex.from_tuples([(1, 2), (3, (4, 5))])
920+
ser = Series([1, 2], index=mi)
921+
result = ser.loc[(3, (4, 5))]
922+
assert result == 2

0 commit comments

Comments
 (0)