MCPcopy
hub / github.com/pandas-dev/pandas / test_get_dummies_index

Function test_get_dummies_index

pandas/tests/strings/test_get_dummies.py:27–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26
27def test_get_dummies_index():
28 # GH9980, GH8028
29 idx = Index(["a|b", "a|c", "b|c"])
30 result = idx.str.get_dummies("|")
31
32 expected = MultiIndex.from_tuples(
33 [(1, 1, 0), (1, 0, 1), (0, 1, 1)], names=("a", "b", "c")
34 )
35 tm.assert_index_equal(result, expected)
36
37
38# GH#47872

Callers

nothing calls this directly

Calls 3

IndexClass · 0.90
get_dummiesMethod · 0.80
from_tuplesMethod · 0.45

Tested by

no test coverage detected