Skip to content
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

Pandas 2.0 change: Groupkey returned from groupby is a tuple instead of single value #1318

Open
HansKallekleiv opened this issue Feb 7, 2025 · 0 comments
Labels
bug 🐛 Something isn't working

Comments

@HansKallekleiv
Copy link
Collaborator

HansKallekleiv commented Feb 7, 2025

import pandas as pd

df = pd.DataFrame({"A": [1, 2], "B": [3, 4]})

for column, _ in df.groupby(["A"]):
    print(column)

Before 2.0:

1
2

After 2.0:

(1,)
(2,)

This might have some unnoticed consequences.

@HansKallekleiv HansKallekleiv added the bug 🐛 Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant