Below first two table is cat1
and cat2
table
basically, I hope to left join cat1
with cat2
, where cat1
date is between start/end date of cat2
Last table is the outcome, how should I achieve this?
Please find the code below for cat1
and cat2
import pandas as pd
from datetime import date
cat1=pd.DataFrame({
"CatID":[1, 2, 3],
"Date":[date(2019,10,1), date(2019,11,1), date(2019,12,1)]
})
cat2=pd.DataFrame({
"Interesting":[1, 2, 3],
"StartDate":[date(2019,10,1), date(2019,11,1), date(2018,10,6)],
"EndDate":[date(2019,10,30), date(2019,11,30), date(2018,10,6)]
})