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

Function test_drop_axis_1

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

Source from the content-addressed store, hash-verified

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