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

Function test_drop_columns

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

dropMethod · 0.95
assert_eqFunction · 0.90

Tested by

no test coverage detected