Add left_by/right_by and left_index/right_index to merge_asof() · Issue #14253 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@chrisaycock

Description

@chrisaycock

The current merge_asof() has only one parameter for by, assuming that both DataFrames have the same column name. It does have left_on and right_on, so perhaps something similar for by would be helpful.

Also, there is no left_index or right_index parameter in merge_asof(). Adding these might be helpful too.

For example:

pd.merge_asof(df1, df2,
              left_index=True, right_on='timestamp',
              left_by='Ticker', right_by='ticker')