Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 59475e8

Browse files
committedAug 3, 2017
TST: added xfailing test on iloc with dups
1 parent 74343c2 commit 59475e8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎pandas/core/dtypes/cast.py

+1
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ def cast_scalar_to_array(shape, value, dtype=None):
10861086

10871087
return values
10881088

1089+
10891090
def _maybe_convert_indexer(indexer, until):
10901091
"""
10911092
Convert slice, tuple, list or scalar "indexer" to 1-d array of indices,

‎pandas/tests/indexing/test_iloc.py

+11
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,17 @@ def test_iloc_setitem_dups(self):
332332
drop=True)
333333
tm.assert_frame_equal(df, expected)
334334

335+
@pytest.mark.xfail(reason="BlockManager.setitem() broken")
336+
def test_iloc_setitem_dups_mixed_df(self):
337+
# GH 12991
338+
df1 = DataFrame([{'A': None, 'B': 1}, {'A': 2, 'B': 2}])
339+
df2 = DataFrame([{'A': 3, 'B': 3}, {'A': 4, 'B': 4}])
340+
df = concat([df1, df2], axis=1)
341+
342+
expected = df.fillna(15)
343+
df.iloc[0, 0] = 15
344+
tm.assert_frame_equal(df, expected)
345+
335346
def test_iloc_getitem_frame(self):
336347
df = DataFrame(np.random.randn(10, 4), index=lrange(0, 20, 2),
337348
columns=lrange(0, 8, 2))

0 commit comments

Comments
 (0)
Please sign in to comment.