Skip to content

Commit b8ee051

Browse files
committed
TST: added xfailing test on iloc with dups
1 parent 4a5d18d commit b8ee051

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/indexing/test_iloc.py

+14
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,20 @@ def test_iloc_setitem_dups(self):
345345
drop=True)
346346
tm.assert_frame_equal(df, expected)
347347

348+
@pytest.mark.xfail(reason="BlockManager.setitem() broken")
349+
def test_iloc_setitem_dups_slice(self):
350+
# GH 12991
351+
df = DataFrame(index=['a', 'b', 'c'],
352+
columns=['d', 'e', 'd']).fillna(0)
353+
expected = df.iloc[:, 2].copy(deep=True)
354+
355+
first_col = df.iloc[:, 0]
356+
first_col['a'] = 3
357+
358+
result = df.iloc[:, 2]
359+
360+
tm.assert_series_equal(result, expected)
361+
348362
def test_iloc_getitem_frame(self):
349363
df = DataFrame(np.random.randn(10, 4), index=lrange(0, 20, 2),
350364
columns=lrange(0, 8, 2))

0 commit comments

Comments
 (0)