-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: left_index AND left_on or right_index AND right_on should raise #16228
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
Comments
I just posted the exact same question: #16229 shall I delete mine |
That's fine , some moderator will most likely merge them. |
The issue here is specifying IIRC we fixed this for |
@jreback Oddly, this does not appear to be fixed in In [4]: df1 = pd.DataFrame({'time': [1, 2, 3], 'value': list("abc")}, index=[100, 101, 102])
In [5]: df2 = pd.DataFrame({'time': [1, 3, 3], 'result': list("xyz")}, index=[100, 103, 104])
In [6]: pd.merge_asof(df1, df2, on='time', left_index=True, right_index=True)
Out[6]:
time value result
100 1 a x
101 2 b x
102 3 c x I thought I had checked for that. I will have to add a guard. |
thanks @chrisaycock I think we should do a more general check before in any event, as this clearly is an error (for all merge functions). and of course the 'detection' logic (of the parameters) is quite complex atm. |
Should this issue also cover preventing |
There seems to be a bug in the pandas merge , particularly on the left_index.
The above two merges give me different output.
This a fork of a stack overflow post-
http://stackoverflow.com/questions/43779003/will-output-change-if-right-index-is-used-instead-of-left-index-with-both-left-o
The text was updated successfully, but these errors were encountered: