title: Python Pandas iterrows() with previous values
body: <p>I have a pandas Dataframe  in the form:</p>
  
  <pre><code>            A           B       K      S
  2012-03-31  NaN         NaN     NaN    10
  2012-04-30  62.74449    15.2    71.64   0
  2012-05-31  2029.487    168.8   71.64   0
  2012-06-30  170.7191    30.4    71.64   0
  </code></pre>
  
  <p>I trying to create a function that  replace df['S']  using df['S'][index-1] value.</p>
  
  <p>for example:</p>
  
  <pre><code>for index,row in df.iterrows:
       if index = 1: 
           pass
       else:
           df['S'] = min(df['A'] + df['S'][index-1]?? - df['B'], df['K'])
  </code></pre>
  
  <p>but i dont know how to get df['S'][index - 1]</p>