Today is 2nd of January, if using Python pandas, any ideas on how to get the previous workweek?
For example today is work week 201801, and previous week is 201752, any ways can find the previous workweek of today?
Today is 2nd of January, if using Python pandas, any ideas on how to get the previous workweek?
For example today is work week 201801, and previous week is 201752, any ways can find the previous workweek of today?
Using Timestamp
and Timedelta
(pd.Timestamp.now()-pd.Timedelta('7 days')).strftime('%Y-%U')
Out[148]: '2017-52'