Skip to content

BUG: merge_ordered gets unexpected left join result #38166

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

Closed
3 tasks
GYHHAHA opened this issue Nov 30, 2020 · 0 comments · Fixed by #38170
Closed
3 tasks

BUG: merge_ordered gets unexpected left join result #38166

GYHHAHA opened this issue Nov 30, 2020 · 0 comments · Fixed by #38170
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@GYHHAHA
Copy link
Contributor

GYHHAHA commented Nov 30, 2020

  • 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.


>>>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

results

>>>pd.merge_ordered(l, r, on='T', left_by=['G'])
G H T E
0 g h 1 nan
1 g h 3 nan

expected

>>>pd.merge_ordered(l, r, on='T', left_by=['G'])
G H T E
0 g h 1 nan
1 g h 2 1
2 g h 3 nan
@GYHHAHA GYHHAHA added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 30, 2020
@jreback jreback added this to the 1.2 milestone Dec 2, 2020
@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants