Skip to content

raise ValueError in DataFrame.groupby.apply when index is duplicated #11810

Closed
@quantchen

Description

@quantchen

Exception is raised when the index is duplicated

Fro example:

df = pd.DataFrame([['a',1],['b',1],['a',2],['b',2]],columns=['c1','c2'], index=list('ccdd'))

df.groupby('c1').apply(lambda x:x)

raise ValueError("cannot reindex from a duplicate axis")
ValueError: cannot reindex from a duplicate axis

This is a new issue affecting 0.17

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions