title: issue with for loop calculation using previous index
body: <p>I have a data frame  that that looks similar to this:
  df</p>
  
  <pre><code>   Year   GDP
     2010   6.100
     2011   7.572
     2012   8.560
  </code></pre>
  
  <p>I'm trying to calculate</p>
  
  <pre><code>`growth_percent = (current_GDP - previous_GDP)/(previous_GDP`)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>growth_increase = current_GDP - past_GDP
  </code></pre>
  
  <p>I've been trying to use a for loop to solve this, but I am not sure how or if I am able to use a past index for the previous value in the situation. </p>