Skip to content

Commit cec7ffe

Browse files
TST: Add non-regression test for GH-33828 (#52744)
* Add non-regression test for GH-33828 * Reformat some lines
1 parent c7375d5 commit cec7ffe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/frame/indexing/test_setitem.py

+9
Original file line numberDiff line numberDiff line change
@@ -1251,3 +1251,12 @@ def test_setitem_column_update_inplace(self, using_copy_on_write):
12511251
df[label][label] = 1
12521252
# original dataframe not updated
12531253
assert np.all(values[np.arange(10), np.arange(10)] == 0)
1254+
1255+
@pytest.mark.parametrize("dtype", ["int64", "Int64"])
1256+
def test_setitem_iloc_with_numpy_array(self, dtype):
1257+
# GH-33828
1258+
df = DataFrame({"a": np.ones(3)}, dtype=dtype)
1259+
df.iloc[np.array([0]), np.array([0])] = np.array([[2]])
1260+
1261+
expected = DataFrame({"a": [2, 1, 1]}, dtype=dtype)
1262+
tm.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)