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

Function test_get_dummies_errors

dask/dataframe/tests/test_reshape.py:168–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166
167
168def test_get_dummies_errors():
169 with pytest.raises(NotImplementedError):
170 # not Categorical
171 s = pd.Series([1, 1, 1, 2, 2, 1, 3, 4])
172 ds = dd.from_pandas(s, 2)
173 dd.get_dummies(ds)
174
175 # unknown categories
176 df = pd.DataFrame({"x": list("abcbc"), "y": list("bcbcb")})
177 ddf = dd.from_pandas(df, npartitions=2)
178 ddf = ddf.astype("category")
179
180 with pytest.raises(NotImplementedError):
181 dd.get_dummies(ddf)
182
183 with pytest.raises(NotImplementedError):
184 dd.get_dummies(ddf, columns=["x", "y"])
185
186 with pytest.raises(NotImplementedError):
187 dd.get_dummies(ddf.x)
188
189
190@pytest.mark.parametrize("values", ["B", ["B"], ["B", "D"]])

Callers

nothing calls this directly

Calls 1

astypeMethod · 0.45

Tested by

no test coverage detected