How to stack timeseries into period with overlap #10298
Unanswered
saschahofmann
asked this question in
General
Replies: 1 comment 2 replies
-
So you want |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to split/stack a timeseries into various periods e.g. imagine a 100 year timeseries. That I would like to split into periods of 20 years. I can do this e.g. like this
As you can see, I am creating an artificial time series since the periods dont really have the same timestamps.
Now what I couldnt figure out is, how to generate periods that overlap - e.g. 20 year periods but for every 10 years. I thought
.rolling
+.construct
should somehow do the trick but I am missing an option to center the rolling groups on the left.The data is shifted I think by 10 years that's why there are NaNs in the beginning.
I guess I could somehow shift or add data before doing the rolling, to make that work but maybe there is a more straightforward way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions