Skip to content

Commit e6cdec8

Browse files
committed
add a test
1 parent fe1a1d1 commit e6cdec8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/frame/indexing/test_setitem.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,19 @@ def test_setitem_index_object_dtype_not_inferring(self):
815815
}
816816
)
817817
tm.assert_frame_equal(df, expected)
818+
819+
def test_setitem_2d_object_array(self):
820+
# GH#61026
821+
df = DataFrame({
822+
"c1": [1, 2, 3, 4, 5],
823+
})
824+
arr = np.array([["A"], ["B"], ["C"], ["D"], ["E"]], dtype=object)
825+
df["c1"] = arr
826+
827+
expected = DataFrame({
828+
"c1": ["A", "B", "C", "D", "E"],
829+
})
830+
tm.assert_frame_equal(df, expected)
818831

819832

820833
class TestSetitemTZAwareValues:

0 commit comments

Comments
 (0)