I have a dataset here - https://docs.google.com/spreadsheets/d/e/2PACX-1vSBxKr2RNSNBt1WLWyqnoBKFPI2YvACVqZpqmmdIR5buI2lF3I76Ta3rIoiirHkxin6guH_ywGsPzc1/pub?gid=1429325005&single=true&output=csv
I want to make a feature "warning" as Y if the "date" of that "location" falls between the "risk_from" and "risk_to" dates of that location. If not, "warning" has to be a N.
Like this:
location case date risk_from risk_to warning
A 2/1/2021 N
A Confirmed 2/2/2021 2/2/2021 2/4/2021 Y
A 2/3/2021 Y
A Confirmed 2/4/2021 2/4/2021 2/6/2021 Y
A 2/5/2021 Y
A 2/6/2021 Y
A 2/7/2021 N
B Confirmed 2/8/2021 2/8/2021 2/10/2021 Y
B 2/9/2021 Y
B 2/10/2021 Y
B 2/11/2021 N
B 2/12/2021 N
I tried to find the range of risk_from and risk_to dates and making them into a set. After that I tried to check each and every current date. If they are in the set then the warning is "Y", if not then the warning is "N". I can find the range between the dates using this answer here but I can't achieve what I want. So looking for expert's advice.