Skip to content

Groupby missing tuple doesn't throw #18798

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
TomAugspurger opened this issue Dec 15, 2017 · 1 comment · Fixed by #18826
Closed

Groupby missing tuple doesn't throw #18798

TomAugspurger opened this issue Dec 15, 2017 · 1 comment · Fixed by #18826
Labels
Bug Groupby Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@TomAugspurger
Copy link
Contributor

Code Sample, a copy-pastable example if possible

import pandas as pd
df = pd.DataFrame(1, index=range(3), columns=pd.MultiIndex.from_product([[1, 2], [3,4]]))
df.groupby((7, 8)).mean()

In 0.20.3 that raised KeyError: 7

On master I get

Out[4]:
   1     2
   3  4  3  4
7  1  1  1  1
8  1  1  1  1

cc @toobaz

@TomAugspurger TomAugspurger added Bug Groupby Regression Functionality that used to work in a prior pandas version labels Dec 15, 2017
@TomAugspurger TomAugspurger added this to the 0.22.0 milestone Dec 15, 2017
@toobaz
Copy link
Member

toobaz commented Dec 15, 2017

Yep, I hadn't tested this... fix ready, after #18731 is pushed I will open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants