Resample time series in pandas to a weekly interval

前端 未结 3 1251
庸人自扰
庸人自扰 2020-12-03 10:46

How do I resample a time series in pandas to a weekly frequency where the weeks start on an arbitrary day? I see that there\'s an optional keyword base but it only works for

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 11:21

    You can pass anchored offsets to resample, among other options they cover this case.

    For example the weekly frequency from Monday:

    ts.resample('W-MON')
    

提交回复
热议问题