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

Function test_isetitem_frame

pandas/tests/copy_view/test_methods.py:1319–1329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1317
1318
1319def test_isetitem_frame():
1320 df = DataFrame({"a": [1, 2, 3], "b": 1, "c": 2})
1321 rhs = DataFrame({"a": [4, 5, 6], "b": 2})
1322 df.isetitem([0, 1], rhs)
1323 assert np.shares_memory(get_array(df, "a"), get_array(rhs, "a"))
1324 assert np.shares_memory(get_array(df, "b"), get_array(rhs, "b"))
1325 assert not df._mgr._has_no_reference(0)
1326 expected = df.copy()
1327 rhs.iloc[0, 0] = 100
1328 rhs.iloc[0, 1] = 100
1329 tm.assert_frame_equal(df, expected)
1330
1331
1332@pytest.mark.parametrize("key", ["a", ["a"]])

Callers

nothing calls this directly

Calls 5

isetitemMethod · 0.95
DataFrameClass · 0.90
get_arrayFunction · 0.90
_has_no_referenceMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected