Skip to content

Commit bfc2da2

Browse files
code sample for pandas-dev#38642
1 parent c32b80b commit bfc2da2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bisect/38642.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pandas as pd
2+
3+
print(pd.__version__)
4+
5+
df = pd.DataFrame(
6+
{"key": pd.Categorical(["b"] * 5, categories=["a", "b", "c", "d"]), "col": range(5)}
7+
)
8+
9+
gb = df.groupby("key")
10+
11+
result = list(gb.indices)
12+
print(result)
13+
# Out[12]: ['a', 'b', 'c', 'd']
14+
15+
assert result == ["a", "b", "c", "d"]

0 commit comments

Comments
 (0)