I'm having a df like this.
timeframe week
0 2023-06-14 24
1 2023-06-21 25
2 2023-06-28 26
3 2023-07-05 27
4 2023-06-12 28
5 2023-06-19 29
6 2023-06-26 30
I want to get the numbering of week 30 as 0 and 29 as 1 and so on.
timeframe week
0 2023-06-14 6
1 2023-06-21 5
2 2023-06-28 4
3 2023-07-05 3
4 2023-06-12 2
5 2023-06-19 1
6 2023-06-26 0
Any solutions?
One easy solution would be to subtract the week from 30:
This however wouldn't consider weeks that are potentially greater than 30 (they would become negative). If you goal is to make the greatest week number 0 and increment the others in reverse order:
Output: