Skip to content

Commit

Permalink
code sample for pandas-dev#38642
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Dec 23, 2020
1 parent c32b80b commit bfc2da2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bisect/38642.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pandas as pd

print(pd.__version__)

df = pd.DataFrame(
{"key": pd.Categorical(["b"] * 5, categories=["a", "b", "c", "d"]), "col": range(5)}
)

gb = df.groupby("key")

result = list(gb.indices)
print(result)
# Out[12]: ['a', 'b', 'c', 'd']

assert result == ["a", "b", "c", "d"]

0 comments on commit bfc2da2

Please sign in to comment.