We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00cd5f1 commit dd28adbCopy full SHA for dd28adb
pandas/tests/indexing/test_loc.py
@@ -3264,3 +3264,11 @@ def test_loc_nonunique_masked_index(self):
3264
index=Index(np.array(ids).repeat(1000), dtype="Int64"),
3265
)
3266
tm.assert_frame_equal(result, expected)
3267
+
3268
+ def test_loc_index_alignment_for_series(self):
3269
+ # GH #56024
3270
+ df = DataFrame({"a": [1, 2], "b": [3, 4]})
3271
+ other = Series([200, 999], index=[1, 0])
3272
+ df.loc[:, "a"] = other
3273
+ expected = DataFrame({"a": [999, 200], "b": [3, 4]})
3274
+ tm.assert_frame_equal(expected, df)
0 commit comments