Skip to content

Commit 59f8a52

Browse files
committed
TST: additional test case for GH4146
1 parent 565ee0c commit 59f8a52

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/test_indexing.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,12 @@ def test_mi_access(self):
10941094
# GH 4146, not returning a block manager when selecting a unique index
10951095
# from a duplicate index
10961096
expected = DataFrame([['a',1,1]],index=['A1'],columns=['h1','h3','h5'],).T
1097-
df3 = df2['A']
1098-
result = df3['A1']
1097+
result = df2['A']['A1']
1098+
assert_frame_equal(result,expected)
1099+
1100+
# selecting a non_unique from the 2nd level
1101+
expected = DataFrame([['d',4,4],['e',5,5]],index=Index(['B2','B2'],name='sub'),columns=['h1','h3','h5'],).T
1102+
result = df2['A']['B2']
10991103
assert_frame_equal(result,expected)
11001104

11011105
if __name__ == '__main__':

0 commit comments

Comments
 (0)