I wonder if you could point me in the right direction?
I have a dataframe with a dateindex and corresponding values:
date|value
2010-10-16 | 485
2010-10-17 | 486
... ...
2013-10-12 | 8588
2013-10-12 | 8589
and I want to split this dataframe into individual dataframes by 6 month date chunks, named period_1, period_2 and so on:
period_1 contains values from 2010-10-18 to (2010-10-18 + 6 months)
period_2 contains values from (2010-10-18 + 6 months) to (2010-10-18 + 6*2 months) and so on.
Is there an elegant way to do this?
I've done this manually by doing
period_1 = df.loc['2010-10-18':'2011-04-01'] and so on but it's a bit tricky...
Thank you.