Get week number with week start day different than monday - Python
问题 I have a dataset with a date column. I want to get the week number associated with each date. I know I can use: x['date'].isocalendar()[1] But it gives me the week num with start day = monday. While I need the week to start on a friday. How do you suggest I go about doing that? 回答1: tl;dr The sections " ISO Standard " and " What you want " is to clarify your need. You could just copy paste the code in the section " Solution " and see if the result is what you want. ISO Standard Definition