title: How to iterate over rows effectively in pandas data-frame using python
body: <p>I have a data-frame which looks like:</p>
  
  <pre><code>A         B       C
  13.06   12.95   -0.11
  92.56   104.63  12.07
  116.49  219.27  102.78
  272.11  487.26  215.15
  300.11  780.75  480.64
  </code></pre>
  
  <p>There are like 1 million records. </p>
  
  <p>I want to create a column D which is calcualted as below:</p>
  
  <p>First value of column <code>D</code> will be 0 and then:</p>
  
  <p><code>Col D3</code>= <code>=(D2+1)*C3/B3</code></p>
  
  <p><code>Col D4</code>= <code>=(D3+1)*C4/B4</code></p>
  
  <p>Column D present value depends on previous value.</p>
  
  <p>Here is the result:</p>
  
  <pre><code>D
  0
  0.115358884
  0.52281017
  0.672397915
  1.02955022
  </code></pre>
  
  <p>I can solve it using <code>for loop and loc</code> but its taking lot of time. Can I solve it in more effective pythonic way?</p>