pandas datetime set Sunday as first day of the week
问题 I've got a dataframe of pandas with a series of dates (all Sundays) like this: Date Year Week 2011-01-02 2011 52 2011-01-23 2011 3 2011-01-23 2011 3 2011-01-30 2011 4 2011-01-30 2011 4 The week is given by df['Date'].dt.week , and what I want is set Sundays as the first day of the week, so I can get: Date Year Week 2011-01-02 2011 1 2011-01-23 2011 4 2011-01-23 2011 4 2011-01-30 2011 5 2011-01-30 2011 5 How can I do that in the simplest way? P.S. I have failed to mention that there're