What is the best way to create a new column and assign a value if date falls between two dates in another dataframe ?
e.g.
dataframe A
date values
2017-05-16 x
2017-04-12 Y
dataframe B #df contains dates to use to filter and associated id
start end id
2017-05-08 2017-05-18 34
2017-04-24 2017-05-08 33
2017-04-03 2017-04-24 32
desired result
dataframe A
date values id
2017-05-16 x 34
2017-04-12 Y 32
I have looked into pd.cut which doesn't seem to work for what I want and it seems inefficient to write a loop to iterate over the dataframe with multiple conditions.