Skip to content

BUG: groupby.agg fails when input has duplicate columns and dict input #55041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rhshadrach opened this issue Sep 7, 2023 · 1 comment · Fixed by #58452
Closed

BUG: groupby.agg fails when input has duplicate columns and dict input #55041

rhshadrach opened this issue Sep 7, 2023 · 1 comment · Fixed by #58452
Labels
Apply Apply, Aggregate, Transform, Map Bug Groupby

Comments

@rhshadrach
Copy link
Member

df = DataFrame(
    [[1, 2, 3, 4], [1, 3, 4, 5], [2, 4, 5, 6]],
    columns=["a", "b", "c", "c"],
)
gb = df.groupby("a")
gb.agg({"c": "sum"})

raises AttributeError: 'DataFrame' object has no attribute 'name'. Did you mean: 'rename'?

I would expect it to aggregate both of the columns named "c".

@undermyumbrella1
Copy link
Contributor

Hi I have created a pr to address this ticket, may I request for some help reviewing it? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Bug Groupby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants