Skip to content

GroupBy on a MultiIndex with the index causes python to stop working #5620

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

If you try following piece of code, my python process crashes:

df = pd.DataFrame({'A':[1,1,2], 'B':[1,2,1], 'C':[1,2,3]})
df = df.set_index(['A', 'B'])
df.index.groupby(df.index)

I know this code is as such probably bullshit (I also did it by accident, the first index shouldn't have been there :-)), but still it should then generate a Error Message instead of causing python to stop?

BTW pd.Index.groupby is a publicly available, but not really clear what is does or is meant for.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions