小编Suh*_*dam的帖子

当年份发生变化时如何使用 pandas 继续周数

示例:通过使用

df['Week_Number'] = df['Date'].dt.strftime('%U') 
for 29/12/2019 the week is 52. and this week is from 29/12/2019 to 04/01/2020.

but for 01/01/2020 the week is getting as 00.
Run Code Online (Sandbox Code Playgroud)

我要求 01/01/2020 的周也为 52。05/01/2020 到 11/01/2020 的周也为 53。这需要继续。

python python-3.x pandas

10
推荐指数
1
解决办法
4316
查看次数

标签 统计

pandas ×1

python ×1

python-3.x ×1