How to apply previous row result in pandas
<p>I'm trying to understand how to go around this in python pandas. My objective is to fill column "RESULT" with the initial investment and apply the profit on top of the previous result. </p>

<p>So if I would use an excel spreadsheet I would do this:</p>

<ol>
<li>Ask what's the initial_investment (in this example $350)</li>
<li>Compute the first row as profit/100*initial_investment + initial_investment </li>
<li>the 2nd and forth will be the same with the exception that "initial_investment" is in the raw above. </li>
</ol>

<p><a href="https://i.stack.imgur.com/PZfgh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PZfgh.png" alt="enter image description here"></a></p>

<p>my initial python code is this</p>

<pre><code>import pandas as pd
df = pd.DataFrame({"DATE":[2009,2010,2011,2012,2013,2014,2015,2016],"PROFIT":[10,4,5,7,-10,5,-5,3],"RESULT":[350,350,350,350,350,350,350,350]})
print df
</code></pre>