Skip to content

Commit 24305ab

Browse files
authored
TST: Test Loc to set Multiple Items to multiple new columns (pandas-dev#42665)
* Modified ecosystem.rst to include ibis * created a test for issue pandas-dev#25594 * Test for issue pandas-dev#25594 * reverted the changes * Test Loc to set Multiple Items to multiple new columns - Changes Made * Test Loc to set Multiple Items to multiple new columns - Changes made and linting addresssed * TST: Test Loc to set Multiple Items to multiple new columns - Changes Made and pre-commit * TST: test for issue pandas-dev#25594 - Changes made * removed the check_dtype
1 parent f72c19b commit 24305ab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/indexing/test_loc.py

+16
Original file line numberDiff line numberDiff line change
@@ -2798,3 +2798,19 @@ def test_loc_setitem_dict_timedelta_multiple_set(self):
27982798
[[Timedelta(6, unit="s"), "foo"]], columns=["time", "value"], index=[1]
27992799
)
28002800
tm.assert_frame_equal(result, expected)
2801+
2802+
def test_loc_set_multiple_items_in_multiple_new_columns(self):
2803+
# GH 25594
2804+
df = DataFrame(index=[1, 2], columns=["a"])
2805+
df.loc[1, ["b", "c"]] = [6, 7]
2806+
2807+
expected = DataFrame(
2808+
{
2809+
"a": Series([np.nan, np.nan], dtype="object"),
2810+
"b": [6, np.nan],
2811+
"c": [7, np.nan],
2812+
},
2813+
index=[1, 2],
2814+
)
2815+
2816+
tm.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)