-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
merge_asof(left_index=True, right_on=...) overwrites left index with right index #33463
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
NB: proving to myself that the indexes returned in examples 2 and 4 are indeed the indexes, not the values:
|
@gtg944q Thank you for the report! Do you mind paste the URL of the examples you found in the docs? we fixed a lot of documentation related problems recently, maybe this is already solved. |
It's the second block of examples at https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.merge_asof.html, but I'm really just building on an example in there, so it's not a documentation problem. |
Since this is advertised as "left-join" like, the last 2 examples you provide are surprising, and I'd expect to propagate the values in the left index (and not reset the index or use the right index). I'll mark as a bug, but this may break some existing tests. |
Building from an example in the docs...
Returned index is the index of left.
Returned index is the index of left.
Return value has index reset (I assume expected?)
Returned index is the index of right.
Perhaps I'm misunderstanding something about how this is supposed to work, but it seems to me that the behavior in the last example is incorrect.
The text was updated successfully, but these errors were encountered: