你好,weekOfYear和pandas.Timestamp.weekofyear规则保持一致,具体规则如下:
如果12月31日是星期一、星期二或星期三,则是下一年的第01周。如果是在星期四,那是在刚刚结束的一年的第53周;如果星期五是第52周(如果刚刚结束的一年是闰年,则是第53周);如果是在周六或周日,则是在一年中刚刚结束的第52周。
If 31 December is on a Monday, Tuesday or Wednesday, it is in week 01 of the next year. If it is on a Thursday, it is in week 53 of the year just ending; if on a Friday it is in week 52 (or 53 if the year just ending is a leap year); if on a Saturday or Sunday, it is in week 52 of the year just ending.