MCPcopy
hub / github.com/pandas-dev/pandas / test_frame_setitem

Function test_frame_setitem

pandas/tests/test_col.py:129–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128
129def test_frame_setitem() -> None:
130 # https://github.com/pandas-dev/pandas/pull/63439
131 df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
132 expr = pd.col("a") == 2
133
134 result = df.copy()
135 result[expr] = 100
136 expected = pd.DataFrame({"a": [1, 100], "b": [3, 100]})
137 tm.assert_frame_equal(result, expected)
138
139
140def test_frame_loc() -> None:

Callers

nothing calls this directly

Calls 2

colMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected