-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
pandas.merge issue with duplicated column names #11762
Comments
hmm, ok though a bit odd to do this. |
Yes, it's clearly not intentional what you're trying to do here. |
I would for now simply raise in this case (a helpful message). If you have a nice use-case to actually do this, then lets reconsider. |
I would also raise an error here, but for simmetry, only if both DF have a different number of duplicates for the column. Ie, this should work, even if with a warning:
|
IIRC we recently allowed duplicates when they are NOT the merge on column. as I said I don't think merging on a duplicate column is ever warranted and I would just raise as this is a source of error/confusion. Having a special case is prob not necessary. |
On 04/12/15 17:55, Jeff Reback wrote:
I see. If it was already agreed, I do not have a strong point for it. |
see #10639 |
I think the issue here is that one can specify columns to merge on just be the column name, and not by the column index, If the latter would be possible, then duplicate column names would not be a problem. |
Looks like we have tested behavior for this now (with a clearer error message) in |
Results in:
See #11754
The text was updated successfully, but these errors were encountered: