'Python Rolling Window with Timestamp
I'm having a hard time looping through my pandas data frame while trying to apply a) a specific window size (6hours) and b) specific step size (1hour). I have tried the pd.rolling function but it doesn't return any values and also doesn't allow me to incorporate a step size.
Below is an example of my dataframe (the entire data set is from 9-01-2018 to 9-30-2018):
195 2018-09-01 02:05:00 19.129037 -25.480032
198 2018-09-01 02:10:00 19.858348 -25.480032
201 2018-09-01 02:15:00 20.485054 -25.580032
204 2018-09-01 02:20:00 13.310732 -25.880032
207 2018-09-01 02:25:00 12.994463 -26.180032
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|