I have calendar dataframe as follows.
calendar = pd.DataFrame({"events": ["e1", "e2", "e3"],
"date_start": ["2021-02-01", "2021-02-06", "2021-02-03"],
"date_end":["2021-02-04", "2021-02-07", "2021-02-03"],
"country": ["us", "us", "uk"]})
calendar["date_start"] = pd.to_datetime(calendar["date_start"])
calendar["date_end"] = pd.to_datetime(calendar["date_end"])
and I have a daily dataframe as follows.
daily = pd.DataFrame({"date": pd.date_range(start="2021-02-01", end="2021-02-08"),
"value":[10, 20, 30, 40, 50, 60, 70, 80]})
I would like to take only events from US and join to the daily dataframe but the joining conditions are (date >= date_start) and (date <= date_end). So the expected output looks like this
date value events
2021-02-01 10 e1
2021-02-02 20 e1
2021-02-03 30 e1
2021-02-04 40 e1
2021-02-05 50
2021-02-06 60 e2
2021-02-07 70 e2
2021-02-08 80
I can do looping but it is not effective. May I have your suggestions how to do in the better way.

