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

Function test_drop_on_column

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

Source from the content-addressed store, hash-verified

352
353
354def test_drop_on_column():
355 df = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6], "c": [0.1, 0.2, 0.3]})
356 df_orig = df.copy()
357 df2 = df.drop(columns="a")
358 df2._mgr._verify_integrity()
359
360 assert np.shares_memory(get_array(df2, "b"), get_array(df, "b"))
361 assert np.shares_memory(get_array(df2, "c"), get_array(df, "c"))
362 df2.iloc[0, 0] = 0
363 assert not np.shares_memory(get_array(df2, "b"), get_array(df, "b"))
364 assert np.shares_memory(get_array(df2, "c"), get_array(df, "c"))
365 tm.assert_frame_equal(df, df_orig)
366
367
368def test_select_dtypes():

Callers

nothing calls this directly

Calls 5

dropMethod · 0.95
DataFrameClass · 0.90
get_arrayFunction · 0.90
copyMethod · 0.45
_verify_integrityMethod · 0.45

Tested by

no test coverage detected