Python Convert ordered list of relative changes to absolute changes
<p>Let's assume I have a set of objects containing: (relative change, time of change):</p>

<pre><code>(+1,0) (-1, 1) (+1,3) (+1, 3) (-1, 5) (+1, 9)  
</code></pre>

<p>Now I want to replace the relative changes by their absolute value, starting at 0:</p>

<pre><code>(1,0) (0, 1) (1,3) (2, 3) (1, 5) (2, 9)
 0+1   0+1-1  0+1-1+1 ...
</code></pre>

<p>What is the best way to do this? Is there a Python function that allows me to</p>

<ul>
<li>Iterate over a (ordered) list of objects</li>
<li>Internally store an absolute value</li>
<li>read the change from each object, update the internal absolute value</li>
<li>replace the relative change with the absolute value</li>
</ul>
