Below, you can find an excerpt from a time series. I would like to slice the rows set apart by the white space (the white space is for clarity's sake, there is no empty row in the data). There is a recurring pattern, i.e. 21 times value X, four different values ABCD, 21 times value Y, four different values EFGH, 21 times value Z etc. In this case, I'm interested in obtaining BCDY, FGHZ and so on.
The problem is that this pattern is sometimes interrupted due to missing data, making it irregular. As a result, the number of values I want to discard (the values X, Y, Z) is sometimes lower than 21. E.g. the values between 2014-01-20 00:05:00 and 2014-01-20 00:11:00 could as well be missing.
I can think of looping over the series, but I prefer a vectorized approach. I would like to implement it in R, but Python or Matlab will do as well.
Any ideas? Thanks.
2014-01-20 00:00:00 197021
2014-01-20 00:01:00 197021
2014-01-20 00:02:00 197021
2014-01-20 00:03:00 197021
2014-01-20 00:04:00 197021
2014-01-20 00:05:00 197021
2014-01-20 00:06:00 197021
2014-01-20 00:07:00 197021
2014-01-20 00:08:00 197021
2014-01-20 00:09:00 197021
2014-01-20 00:10:00 197021
2014-01-20 00:11:00 197021
2014-01-20 00:12:00 197021
2014-01-20 00:13:00 197021
2014-01-20 00:14:00 197021
2014-01-20 00:15:00 197021
2014-01-20 00:16:00 196836
2014-01-20 00:17:00 196865
2014-01-20 00:18:00 196787
2014-01-20 00:19:00 196915
2014-01-20 00:20:00 196902
2014-01-20 00:21:00 196902
2014-01-20 00:22:00 196902
2014-01-20 00:23:00 196902
2014-01-20 00:24:00 196902
2014-01-20 00:25:00 196902
2014-01-20 00:26:00 196902
2014-01-20 00:27:00 196902
2014-01-20 00:28:00 196902
2014-01-20 00:29:00 196902