Skip to content

Commit 0321ee4

Browse files
Add non-regression test for pandas-devGH-33828
1 parent 23f74d3 commit 0321ee4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/frame/indexing/test_setitem.py

+16
Original file line numberDiff line numberDiff line change
@@ -1251,3 +1251,19 @@ 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(
1256+
"dtype",
1257+
[
1258+
"int64",
1259+
"Int64",
1260+
],
1261+
)
1262+
def test_setitem_iloc_with_numpy_array(self, dtype):
1263+
# GH-33828
1264+
df = DataFrame({"a": np.ones(3)}, dtype=dtype)
1265+
df.iloc[np.array([0]), np.array([0])] = np.array([[2]])
1266+
1267+
expected = DataFrame({"a": [2, 1, 1]}, dtype=dtype)
1268+
1269+
tm.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)