Skip to content

Commit 983eb1d

Browse files
committed
Failing test_setitem_integer_array_with_repeats
1 parent 41f3c2e commit 983eb1d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/extension/base/setitem.py

+16
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,22 @@ def test_setitem_integer_array(self, data, idx, box_in_series):
202202
arr[idx] = arr[0]
203203
tm.assert_equal(arr, expected)
204204

205+
@pytest.mark.parametrize(
206+
"idx",
207+
[[0, 0, 1], pd.array([0, 0, 1], dtype="Int64"), np.array([0, 0, 1])],
208+
ids=["list", "integer-array", "numpy-array"],
209+
)
210+
def test_setitem_integer_array_with_repeats(self, data, idx, box_in_series):
211+
arr = data[:5].copy()
212+
expected = data.take([2, 3, 2, 3, 4])
213+
214+
if box_in_series:
215+
arr = pd.Series(arr)
216+
expected = pd.Series(expected)
217+
218+
arr[idx] = [arr[2], arr[2], arr[3]]
219+
tm.assert_equal(arr, expected)
220+
205221
@pytest.mark.parametrize(
206222
"idx, box_in_series",
207223
[

0 commit comments

Comments
 (0)