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

Function test_drop_axis_1

dask/dataframe/tests/test_dataframe.py:2704–2716  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2702
2703
2704def test_drop_axis_1():
2705 df = pd.DataFrame({"x": [1, 2, 3, 4], "y": [5, 6, 7, 8], "z": [9, 10, 11, 12]})
2706 ddf = dd.from_pandas(df, npartitions=2)
2707
2708 assert_eq(ddf.drop("y", axis=1), df.drop("y", axis=1))
2709 assert_eq(ddf.drop(["y", "z"], axis=1), df.drop(["y", "z"], axis=1))
2710 with pytest.raises((ValueError, KeyError)):
2711 ddf.drop(["a", "x"], axis=1)
2712 assert_eq(
2713 ddf.drop(["a", "x"], axis=1, errors="ignore"),
2714 df.drop(["a", "x"], axis=1, errors="ignore"),
2715 )
2716 assert_eq(ddf.drop(columns=["y", "z"]), df.drop(columns=["y", "z"]))
2717
2718
2719@pytest.mark.parametrize("columns", [["b"], []])

Callers

nothing calls this directly

Calls 2

dropMethod · 0.95
assert_eqFunction · 0.90

Tested by

no test coverage detected