I am not sure I can completely understand all your questions, but since you are talking about data frames, I suspect that you are using Pandas package.
Pandas supports rolling windows. It could be applied to DataFrame and Series instances. Why do you need to pick windowed data up?
As far as I undertood you correctly, you are trying to do something like this (but with data frames):
Note, you usually don't need to store right side of rolling operation. Usually, rolling window is applyied to
obtain, e.g., moving average values. In pandas this could be easily done using
Pandas supports rolling windows. It could be applied to DataFrame and Series instances. Why do you need to pick windowed data up?
As far as I undertood you correctly, you are trying to do something like this (but with data frames):
Quote:[1, 2, 3, 4, 5] => applying rolling window of size 3 => [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
Note, you usually don't need to store right side of rolling operation. Usually, rolling window is applyied to
obtain, e.g., moving average values. In pandas this could be easily done using
.rolling
method: df.rolling(3).mean()
df.rolling(3).sum()
, or if df has time-based index, df.rolling('3s').mean()
.