Skip to content

DataFrame.melt fails if there are duplicate value_vars #41951

Closed
@swenlaur

Description

@swenlaur

DataFrame.columns.get_indexer fails if there are duplicate column names.

idx = frame.columns.get_indexer(id_vars + value_vars)

This is really unfortunate -- melting should handle such cases

id value value
id1 2 3

should go to

id1 2
id1 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionFunctionality that used to work in a prior pandas versionReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions