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

Function test_truncate

pandas/tests/copy_view/test_methods.py:827–837  ·  view source on GitHub ↗
(kwargs)

Source from the content-addressed store, hash-verified

825 ],
826)
827def test_truncate(kwargs):
828 df = DataFrame({"a": [1, 2, 3], "b": 1, "c": 2})
829 df_orig = df.copy()
830 df2 = df.truncate(**kwargs)
831 df2._mgr._verify_integrity()
832
833 assert np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
834
835 df2.iloc[0, 0] = 0
836 assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
837 tm.assert_frame_equal(df, df_orig)
838
839
840@pytest.mark.parametrize("method", ["assign", "drop_duplicates"])

Callers

nothing calls this directly

Calls 5

DataFrameClass · 0.90
get_arrayFunction · 0.90
copyMethod · 0.45
truncateMethod · 0.45
_verify_integrityMethod · 0.45

Tested by

no test coverage detected