q = collections.deque()
for t, v in the_data:
    while q and q[0][0] <= t - delta:
        _unused = q.popleft()
q.append((t, v))
count = len(q)
print(t, sum(item[1] for item in q) / count, count)
сглаживание нерегулярно выбранных временных данных