Linked Questions

0 votes
0 answers
941 views

If I have two dates (ex. '3/1/2016' and '2/28/2017') what is the best way to get the difference measured in weeks?
Simon Wang's user avatar
  • 2,273
0 votes
0 answers
117 views

I want to write a python code that finds Sundays between 1.1.1500 and 31.12.1600 without using any library. I have printed the dates in the following code.I try to find sunday divide seven but I think ...
ford's user avatar
  • 19
595 votes
16 answers
750k views

Is there any benefit to use one over the other? In Python 2, they both seem to return the same results: >>> 6/3 2 >>> 6//3 2
Ray's user avatar
  • 194k
10 votes
5 answers
5k views

Example: By using df['Week_Number'] = df['Date'].dt.strftime('%U') for 29/12/2019 the week is 52. and this week is from 29/12/2019 to 04/01/2020. but for 01/01/2020 the week is getting as 00. I ...
Suhas_mudam's user avatar
7 votes
5 answers
344 views

Consider the following list of day-of-week-hour pairs in 24H format: { 'Mon': [9,23], 'Thu': [12, 13, 14], 'Tue': [11, 12, 14], 'Wed': [11, 12, 13, 14] 'Fri': [13], 'Sat': [], 'Sun': [], } and ...
Amelio Vazquez-Reina's user avatar
3 votes
1 answer
3k views

Say I have a data frame with two columns Start End 1/1/2015 1/5/2015 1/10/2015 1/12/2015 What would be the best method to get the dates in between the start and end (the actual dates, not the ...
mrsquid's user avatar
  • 645
0 votes
3 answers
1k views

My data has trips with datetime info, user id for each trip and trip type (single, round, pseudo). Here's a data sample (pandas dataframe), named All_Data: HoraDTRetirada idpass type ...
Helk's user avatar
  • 121
1 vote
2 answers
811 views

The Goal: Once a user has signed up they start a challenge. Once they've started the challenge I'd like to be able to send users weekly emails for 12 weeks (Or however long the challenge lasts for). ...
JDavies's user avatar
  • 2,770
1 vote
1 answer
409 views

With code as simple as shown below, you can get the number of days, that have passed since epoch. from time import time secs = time() day = 24 * 60 * 60 days = int(secs // day) print(days) But now I ...
Muhammad Usman's user avatar
0 votes
1 answer
67 views

Docs say I can pull out the week of the year from the timestamp: pd.to_datetime('03-01-2021').week -> 9 But I need weeks since the epoch. I have to do gaps and islands analysis, so I need to wind ...
naftalimich's user avatar