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

Function test_inplace_ops

pandas/tests/test_col.py:90–100  ·  view source on GitHub ↗
(
    op: Callable, expected_values: list[object], expected_str: str
)

Source from the content-addressed store, hash-verified

88 ],
89)
90def test_inplace_ops(
91 op: Callable, expected_values: list[object], expected_str: str
92) -> None:
93 # https://github.com/pandas-dev/pandas/pull/64267
94 df = pd.DataFrame({"a": [1, 2]})
95 expr = pd.col("a")
96 expr = op(expr, 2)
97 result = df.assign(c=expr)
98 expected = pd.DataFrame({"a": [1, 2], "c": expected_values})
99 tm.assert_frame_equal(result, expected)
100 assert str(expr) == expected_str
101
102
103def test_matmul():

Callers

nothing calls this directly

Calls 3

assignMethod · 0.95
opFunction · 0.85
colMethod · 0.80

Tested by

no test coverage detected