Skip to content

Groupby missing tuple doesn't throw #18798

Closed
@TomAugspurger

Description

@TomAugspurger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugGroupbyRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions