From c4e1c186d7fa0cb2800d6a3ab430ab916a7a1310 Mon Sep 17 00:00:00 2001 From: Niruta Talwekar Date: Tue, 24 Jun 2025 14:10:47 -0700 Subject: [PATCH 1/3] slack link update --- doc/source/development/community.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/development/community.rst b/doc/source/development/community.rst index 1c698d130ea6c..e139ea0376771 100644 --- a/doc/source/development/community.rst +++ b/doc/source/development/community.rst @@ -114,7 +114,7 @@ people who are hesitant to bring up their questions or ideas on a large public mailing list or GitHub. If this sounds like the right place for you, you are welcome to join using -`this link `_! +`this link `_! Please remember to follow our `Code of Conduct `_, and be aware that our admins are monitoring for irrelevant messages and will remove folks who use our From a1f342d2012349ab4706fa794208b45ef7270b1a Mon Sep 17 00:00:00 2001 From: Niruta Talwekar Date: Wed, 9 Jul 2025 23:29:25 -0700 Subject: [PATCH 2/3] Adding two tests --- pandas/tests/frame/test_api.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index af61cd75c4540..6efe296049b60 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -402,3 +402,22 @@ def test_inspect_getmembers(self): # GH38740 df = DataFrame() inspect.getmembers(df) + + def test_setitem_series_alignment_documentation(self): + # Test that Series assignment aligns by index as documented. + df = DataFrame({"A": [1, 2, 3]}, index=[0, 1, 2]) + s = Series([10, 20], index=[1, 3]) + df["B"] = s + expected = DataFrame({"A": [1, 2, 3], "B": [np.nan, 10, np.nan]}) + tm.assert_frame_equal(df, expected) + + def test_setitem_series_partial_alignment(self): + # Test Series assignment with partial index match. """ + df = DataFrame({"A": [1, 2, 3, 4]}, index=["a", "b", "c", "d"]) + s = Series([100, 200], index=["b", "d"]) + df["B"] = s + expected = DataFrame( + {"A": [1, 2, 3, 4], "B": [np.nan, 100, np.nan, 200]}, + index=["a", "b", "c", "d"], + ) + tm.assert_frame_equal(df, expected) From 184bcac88e08f4108c05ec8ca7ae7f051fb9359f Mon Sep 17 00:00:00 2001 From: Niruta Talwekar Date: Wed, 9 Jul 2025 23:30:47 -0700 Subject: [PATCH 3/3] remove whitespace and extra quotes --- pandas/tests/frame/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index 6efe296049b60..f0527da0a3525 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -412,7 +412,7 @@ def test_setitem_series_alignment_documentation(self): tm.assert_frame_equal(df, expected) def test_setitem_series_partial_alignment(self): - # Test Series assignment with partial index match. """ + # Test Series assignment with partial index match. df = DataFrame({"A": [1, 2, 3, 4]}, index=["a", "b", "c", "d"]) s = Series([100, 200], index=["b", "d"]) df["B"] = s