-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: merge_ordered fails with list-like left_by or right_by #38089
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
Conversation
# GH 35269 | ||
left = DataFrame({"G": ["g", "g"], "H": ["h", "h"], "T": [1, 3]}) | ||
right = DataFrame({"T": [2], "E": [1]}) | ||
result = merge_ordered(left, right, on=["T"], left_by=["G", "H"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you test the same with on='T'
also can you test with right_by
There also exists two parts should be fixed. >>>l = pd.DataFrame([['g', 'h', 1], ['g', 'h', 3]], columns=list('GHT'))
>>>l
G H T
0 g h 1
1 g h 3
>>>r = pd.DataFrame([[2, 1]], columns=list('TE'))
>>>r
T E
0 2 1 First, the following unexpected left join is related to wrongly >>>pd.merge_ordered(l, r, on='T', left_by=['G'])
Second, unexpected result appears when unseen label exists in >>>pd.merge_ordered(l, r, on='T', left_by=['G', 'h'])
Since they are different bugs from the current list-like issue, thus I will make another PR for the above-mentioned two after this merged. |
# GH 35269 | ||
left = DataFrame({"G": ["g", "g"], "H": ["h", "h"], "T": [1, 3]}) | ||
right = DataFrame({"T": [2], "E": [1]}) | ||
result1 = merge_ordered(left, right, on=["T"], left_by=["G", "H"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you parameterize this test with the cases
failures from |
thanks @GYHHAHA very nice! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff