I have a bit of a puzzle. I want to make certain date slots for every participant in my dataset to get an appointment. I have a date range that goes from 14 days until a flu shot up until the flu shot. So if the flu shot is schedule for the 29th of April 2021, the appointment can take place from the 15th of April until the 28th of April 2021. The flu shot dates of course vary per participant. Per date, there is a maximum amount of participants per appointment (let's say 8 participants per date). I managed (with help from you guys) to create a dataframe with all the dates that an appointment is possible per participant:
Each row is for one participant
What I need from this dataframe is to check that if the first possible date occurs 8 times or less (slot is not filled yet), place that date in a new column. Then, when the slot of 8 for that date is filled, continue to the next date until that reaches the maximum of 8 again, etc etc
The outcome should then be an additional column with the date of the appointment for every participant.
I hope i tried to make this clear enough but otherwise let me know. I have been breaking my brain over this because I don't even know if this is the best way to do it so ANY help is greatly appreciated.
Thanks a lot!