Feature Request: Left join conditionally on timestamps in pd.merge_asof(…)
As the title states, it would great to have the option to left-join in a pd.merge_asof().  Currently it only supports 1-1 joins.

See this post on stack overflow:  https://stackoverflow.com/questions/57825101/left-join-conditionally-on-timestamps-in-pd-merge-asof.

Lets say I have two dataframes that I would like left join based on timestamp in a range based on the left table's timestamp. I would like to use pd.merge_asof(...) to do this but it seems like that function only joins to the nearest row in the right dataframe, and I would like for each row in the right dataframe to join to the left based on proximity to the left dataframe's timestamp.

For example:

    df1:
         TS1                    id1
    1    2019-08-15 16:45:00	1
    2    2019-08-15 17:00:00	2
    3    2019-08-15 17:15:00	3
    
    df2:
         TS2                    id2
    1    2019-08-15 16:45:00	1
    2    2019-08-15 16:45:00    2
    3    2019-08-15 16:46:00    3
    4    2019-08-15 17:00:00	4
    5    2019-08-15 17:01:00	5
    6    2019-08-15 17:15:00	6

What I have tried:

    test = pd.merge_asof(
        df1.sort_values('TS1'), 
        df2.sort_values('TS2'), 
        left_on='TS1', 
        right_on='TS2', 
        direction='forward'
    )

Which gives:


         TS1                    TS2                    id1    id2
    1    2019-08-15 16:45:00	2019-08-15 16:45:00    1      1
    2    2019-08-15 17:00:00	2019-08-15 17:00:00    2      4
    3    2019-08-15 17:15:00	2019-08-15 17:15:00    3      6

What I would like to see is:

         TS1                    TS2                    id1    id2
    1    2019-08-15 16:45:00	2019-08-15 16:45:00    1      1
    2    2019-08-15 16:45:00	2019-08-15 16:45:00    1      2
    3    2019-08-15 16:45:00	2019-08-15 16:46:00    1      3
    4    2019-08-15 17:00:00	2019-08-15 17:00:00    2      4
    5    2019-08-15 17:00:00	2019-08-15 17:01:00    2      5
    6    2019-08-15 17:15:00	2019-08-15 17:15:00    3      6

It would also be great if you could somehow specify a window based on another timestamp column from the same row in the left table. 