-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DataFrame.melt fails if there are duplicate value_vars #41951
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
Comments
Thanks @swenlaur for the report. Please read this guide detailing how to provide the necessary information for us to reproduce your bug. and can you use the bug template that is available when you open an issue from the GitHub web interface. |
Minimal code to trigger the bug (regression from earlier versions)
The resulting data frame contains columns with the same name. This is not illegal as sometimes uncleaned data in this form and the most sane way to clean it is using melt. |
will add the regression tag for now pending investigation. posting more info on versions could help |
I do not know the highest package number but repro works with pandas=1.0.0. I guess it stoped working after the multi-level colums patch was added to the code. |
DataFrame.columns.get_indexer fails if there are duplicate column names.
pandas/pandas/core/reshape/melt.py
Line 109 in 05552d3
This is really unfortunate -- melting should handle such cases
id value value
id1 2 3
should go to
id1 2
id1 3
The text was updated successfully, but these errors were encountered: