this is a variation on a similar question i asked: filling last known data with pandas
in a nutshell, i wanted to know how to forward fill timeseries data, while noting the ID of each data point.
ergo, this
2014-07-24 17:49:00 5 1046.0 -3.0 -239.0 2800.0
...
2015-05-05 15:00:00 2 NaN NaN NaN 2680
2015-05-05 15:00:00 3 0989 0020 -0011 2680
2015-05-05 15:00:00 4 1022 0060 -0076 2600
2015-05-05 15:00:00 5 NaN NaN NaN 2623
becomes
2015-05-05 15:00:00 2 NaN NaN NaN 2680
2015-05-05 15:00:00 3 0989 0020 -0011 2680
2015-05-05 15:00:00 4 1022 0060 -0076 2600
2015-05-05 15:00:00 5 1046 -3.0 -239.0 2623
noting that the last known data for ID=5 was from 2014-07-24 17:49:00
the variation now would be to do the same thing, only that it should consider a "validity period" for the data. what i tried doing was assigning a datetimeIndex
and then slicing the dataframe from that vaild time period df[start:end]
and then doing the fix on my previous question.
This however resulted in a separate subset than my "big" dataframe. what i need is to do the operation on my "big dataframe" and be able to move this window and move through all of the data.