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

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

Closed
jreback opened this Issue Nov 1, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@jreback
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
@achiwhane

This comment has been minimized.

Show comment
Hide comment
@achiwhane

achiwhane Nov 2, 2017

Hi,

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

achiwhane commented Nov 2, 2017

Hi,

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

manrajgrover added a commit to manrajgrover/pandas that referenced this issue Nov 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment