Skip to content

ERR: better error message on merging for incompat types #18068

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
jreback opened this issue Nov 1, 2017 · 1 comment · Fixed by #18082
Closed

ERR: better error message on merging for incompat types #18068

jreback opened this issue Nov 1, 2017 · 1 comment · Fixed by #18082
Labels
Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Nov 1, 2017

would be nice to have the types outputted in the error message

In [23]:         left = pd.DataFrame({'a': [1, 5, 10],
    ...:                              'left_val': ['a', 'b', 'c']})
    ...:         right = pd.DataFrame({'a': [1, 2, 3, 6, 7],
    ...:                               'right_val': [1, 2, 3, 6, 7]})
    ...: 
    ...: 

In [24]: pd.merge_asof(left, right, on='a')
Out[24]: 
    a left_val  right_val
0   1        a          1
1   5        b          3
2  10        c          7

In [25]: pd.merge_asof(left, right.assign(a=right.a.astype('i4')), on='a')
MergeError: incompatible merge keys, must be the same type
@jreback jreback added Difficulty Novice Error Reporting Incorrect or improved errors from pandas labels Nov 1, 2017
@jreback jreback added this to the 0.21.1 milestone Nov 1, 2017
@achiwhane
Copy link

Hi,

I'm new to contributing to pandas and would love to take a crack at this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants