Open austin3dickey opened 5 years ago
Hey - I know that I'm resurrecting a pretty old issue here, but I was wondering whether this is something that might be addressed at some point? I had originally assumed that the default interaction with pd.merge
would be the same as pd.merge_ordered
but I'm finding that index merging support doesn't seem to be in parity with the more widely-used counterpart. Very easy to work around so it's not pressing, but figured that I would bump this issue to resurface it.
I would find this useful too. One of the issues I am having is that many of the ways to do this kind of thing create intermediate states with missing values (NaN) which results in int columns being converted to float as part of the process. I am currently using concat with sort_index, which is very inefficient if both the input dataframes are sorted. This look like it could work for my use case if it could use the index directly.
Code Sample, a copy-pastable example if possible
Problem description
The error message above implies that I should be able to merge these two timeseries DataFrames using
left_index=True
andright_index=True
. But these are not arguments to themerge_ordered()
function like they are to other merging functions.I could work around this by doing the following:
but that seems unnecessarily verbose, and possibly less performant than if I could do
Proposal
It looks like
merge_ordered()
uses_OrderedMerge
under the hood which can take theleft_index
andright_index
arguments (and the code example above works as expected if those arguments are passed through). Would you consider adding these arguments? I can create a PR if there's appetite.Output of
pd.show_versions()