1

I am trying to merge 2 data frames using 4 columns to join on. On one of the columns I want to join on (DateA=DateB or DateA=DateB-1 or DateA=DateB-2) so that it connects DateA to all events occurring on DateB or up to two days after DateB.

I have the following code which is for all the and conditions but I'm not sure how to add in the extra or condition date specifications:

results=pd.merge(data,discreps, how='left', left_on=['DateA','ZA','XA','YA'], 
                            right_on=['DateB','ZB','XB','YB'])
user3242036
  • 645
  • 1
  • 7
  • 16

0 Answers0