Skip to content
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

[REVIEW] Retain index correctly during merge left_on right_on #1840

Conversation

thomcom
Copy link
Contributor

@thomcom thomcom commented May 23, 2019

Fixes #1806

In [1]: import cudf
   ...:
   ...: df = cudf.DataFrame()
   ...: df['a'] = [1,2,3,4,5]
   ...: df['b'] = ['a','b','c','d','e']
   ...: df.index=[5,3,4,2,1]
   ...:
   ...: df2 = cudf.DataFrame()
   ...: df2['a2'] = [1,2,3,4,5]
   ...: df2['res'] = ['a','b','c','d','e']
   ...:
   ...: df.merge(df2,left_index=True,right_index=True,how='left').to_pandas()
Out[1]:
   a  b  a2   res
5  1  a  -1  None
3  2  b   4     d
4  3  c   5     e
2  4  d   3     c
1  5  e   2     b

@thomcom thomcom requested a review from a team as a code owner May 23, 2019 18:57
@kkraus14 kkraus14 added 5 - Ready to Merge Testing and reviews complete, ready to merge Python Affects Python cuDF API. and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF Reviewer labels May 28, 2019
@kkraus14 kkraus14 merged commit 0c533ad into rapidsai:branch-0.8 May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Merging on index gives incorrect index in result
2 participants