Add random dates

PHOTO EMBED

Sun Mar 12 2023 12:39:29 GMT+0000 (Coordinated Universal Time)

Saved by @CarlosR

# initializing dates ranges
test_date1, test_date2 = date(2021, 6, 3), date(2023, 3, 3)
 
# initializing K
K = len(visits_content_users[user_id_column])
 
# getting days between dates
dates_bet = test_date2 - test_date1
total_days = dates_bet.days
 
res = []
for idx in range(K):
    random.seed(a=None)
     
    # getting random days
    randay = random.randrange(total_days)
     
    # getting random dates
    res.append(test_date1 + timedelta(days=randay))

visits_content_users['Dates'] = res
content_copyCOPY