Skip to content

Add left_by/right_by and left_index/right_index to merge_asof() #14253

Closed
@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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions