-2

In my current python script i have 2 dataframes. I want to link those 2 dataframes based on multiple values, one of them is a between dates part. The between part is really important. I want to achieve the same as in the query below:

Select *
from x
Join y on x.customerid = y.customerid and x.date between y.date and dateadd(minutes, 15, y.date)

Can anyone please help me out? I have searched for a few hours now on 'Python join/merge between dates', but i haven't found any information.

Bjarne
  • 1
  • 1
  • Sample data including input and expected output can help you to get some answers. – AtanuCSE Aug 18 '20 at 12:29
  • Please share a sample of your data. Have you checked this: https://stackoverflow.com/questions/41815079/pandas-merge-join-two-data-frames-on-multiple-columns – Hamid Aug 18 '20 at 14:19

1 Answers1

0
pd.merge(x, y, on=['customerid', 'date'])
Alex Rika
  • 141
  • 2
  • 14