def join_series(s1, s2):
    S1 = iter(s1)
S2 = iter(s2)
value1 = 0
value2 = 0
time1, next1 = next(S1)
time2, next2 = next(S2)
end1 = False
end2 = False
while True:
    time = min(time1, time2)
if time == time1:
    value1 = next1
try:
    time1, next1 = next(S1)
except StopIteration:
    end1 = True
time1 = time2
if time == time2:
    value2 = next2
try:
    time2, next2 = next(S2)
except StopIteration:
    end2 = True
time2 = time1
yield time, value1 + value2
if end1 and end2:
    raise StopIteration
S1 = (1, 100), (5, 100), (10, 100)
S2 = (4, 150), (5, 100), (18, 150)
for result in join_series(S1, S2):
    pass
Алгоритм суммирования/суммирования значений из графика временных рядов, где точки данных не совпадают по времени