MCPcopy Create free account
hub / github.com/dask/dask / test_drop_columns

Function test_drop_columns

dask/dataframe/tests/test_dataframe.py:2718–2732  ·  view source on GitHub ↗
(columns)

Source from the content-addressed store, hash-verified

2716
2717@pytest.mark.parametrize("columns", [["b"], []])
2718def test_drop_columns(columns):
2719 # Check both populated and empty list argument
2720 # https://github.com/dask/dask/issues/6870
2721
2722 df = pd.DataFrame(
2723 {
2724 "a": [2, 4, 6, 8],
2725 "b": ["1a", "2b", "3c", "4d"],
2726 }
2727 )
2728 ddf = dd.from_pandas(df, npartitions=2)
2729 ddf2 = ddf.drop(columns=columns)
2730 ddf["new"] = ddf["a"] + 1 # Check that ddf2 is not modified
2731
2732 assert_eq(df.drop(columns=columns), ddf2)
2733
2734
2735def test_gh580():

Callers

nothing calls this directly

Calls 2

dropMethod · 0.95
assert_eqFunction · 0.90

Tested by

no test coverage detected