小编cla*_*bot的帖子

使用列中的日期范围扩展pandas数据框

我有一个pandas数据帧,其日期和字符串与此类似:

Start        End           Note    Item
2016-10-22   2016-11-05    Z       A
2017-02-11   2017-02-25    W       B
Run Code Online (Sandbox Code Playgroud)

我需要将它扩展/转换为下面的内容,在StartEnd列之间填写几周(W-SAT)并转发填写NoteItems中的数据:

Start        Note    Item
2016-10-22   Z       A
2016-10-29   Z       A
2016-11-05   Z       A
2017-02-11   W       B
2017-02-18   W       B
2017-02-25   W       B
Run Code Online (Sandbox Code Playgroud)

什么是与熊猫一起做到这一点的最好方法?某种多指数适用?

python pandas

15
推荐指数
4
解决办法
6140
查看次数

标签 统计

pandas ×1

python ×1