# Time Series - Values recorded every 10 minutes - Fill missing values

I have a time series data from a sensor that records value periodically - sometimes - every 10 minute period, other times every 5 minute period etc. I have to find out anomalies in real time (as and when data comes) based on breach of a static threshold value.

Question is related to the minutes fall within the period and do not have any recordings.

Let's assume today the sensor is recording values every 10 minutes (APPROXIMATELY) as shown below. What is the best possible way to handle the data in between the periodic interval. In below example, should I do a back fill with value 12 for all the points from 13:02 to 13:09?

2019-04-25T13:01:00  10,
2019-04-25T13:02:00  NAN,
2019-04-25T13:03:00  NAN,
2019-04-25T13:04:00  NAN,
2019-04-25T13:05:00  NAN,
2019-04-25T13:06:00  NAN,
2019-04-25T13:07:00  NAN,
2019-04-25T13:08:00  NAN,
2019-04-25T13:09:00  NAN,
2019-04-25T13:10:00  12,
2019-04-25T13:11:00  NAN,
2019-04-25T13:12:00  NAN,
2019-04-25T13:13:00  NAN,
2019-04-25T13:14:00  NAN,
2019-04-25T13:15:00  NAN,
2019-04-25T13:16:00  NAN,
2019-04-25T13:17:00  NAN,
2019-04-25T13:18:00  NAN,
2019-04-25T13:19:00  11,
2019-04-25T13:20:00  NAN

• If you are processing in real time, and only thresholding, what point do you see in back filling at all? – Stephen Rauch Apr 25 '19 at 14:03
• @StephenRauch There are 2 parts of use case - use case 1 is based on static threshold. Use case 2 (not mentioned before) is based on dynamic threshold whose value keeps on changing based on past data. This dynamic threshold is derived from mean (or exponential mean etc) of past values. This derivation requires me to get past data as well. Apologies for not mentioning this detail before. – Siddharth vij Apr 26 '19 at 14:00
• But why do you suppose that filling in data will help with computing a dynamic threshold? – Stephen Rauch Apr 27 '19 at 1:40