-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: merge drops index components sometimes, when join is empty #34357
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
@phofl
Try using this. |
You are right, the merge method should be left. That was a copy and paste bug. If you change the Your example is uncorrelated with mine. If you perform your merge over the index, the inconsistent behavior occurs. I know that you could your transform your data in a way that it works, but the inconsistent behavior is still there. |
No, looks alike, but is different. #34292 runs into
This is in merge.py line 870 The error occurs somewhere in there. Mine runs into the else block. |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
The first merge changes the index of the left
DataFrame
in a way, that the index componenta
is dropped.The second merge returns the original index respectively
DataFrame
after resetting the index. I think this is the expected output.Expected Output
Output of
pd.show_versions()
Was tested on master.
The text was updated successfully, but these errors were encountered: