jeudi 20 juillet 2023

Randomly selecting a time on the half hour with a one hour buffer between two columns

I have a dataframe containing two different columns:

StartTime EndTime
8:00 2:00
8:00 12:00
8:00 4:00
2:00 6:00
12:00 6:00

I want to create another column "SelectedTime" that is a randomly selected time on half hour increments (1:00, 1:30, 2:00, 2:30) with an hour buffer between StartTime and EndTime. So for row one it would be a random time between 9:00 and 1:00. Is this possible?




Aucun commentaire:

Enregistrer un commentaire