Skip to content

Commit 74d8a65

Browse files
code sample for pandas-dev#44924
1 parent 3d63f21 commit 74d8a65

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bisect/44924.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUG: misleading error message when aggregating duplicate column names in groupby #44924
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
grp = pd.DataFrame.from_dict(
8+
{
9+
"A": [1, 2],
10+
"B": [3, 3],
11+
"C": ["G", "G"],
12+
}
13+
).groupby("C")
14+
15+
print([i for i in grp])
16+
17+
grp2 = grp[["A", "B", "A"]]
18+
print(grp2.mean())

0 commit comments

Comments
 (0)