0

I know I can resample daily data, by month, like this:

df = data.resample('M')

But how do I resample by an arbitrary length, say 180?

df = data.resample('Days', 180) # six months # I am just guessing here
rafaelc
  • 57,686
  • 15
  • 58
  • 82
Ivan
  • 7,448
  • 14
  • 69
  • 134

1 Answers1

2

Use the rule directly

df = data.resample('180D')

For a list of possibilities on rules, please refer to the docs. There's a nice summary table in this link.

rafaelc
  • 57,686
  • 15
  • 58
  • 82