title: Finding out the previous index value of a value in a column in pandas
body: <p>For a column "stock" in a pandas dataframe, I want to add a column called last_index which gives the value of the index value before for a given Stock:</p>
  
  <p>Input:</p>
  
  <pre><code>           Stock
  02/10/17    IBM
  02/10/17    Apple
  02/10/17    Google
  02/10/17    Microsoft
  02/10/17    Lenova
  02/10/17    Nintendo
  02/10/17    Sony
  02/10/17    Toshiba
  03/10/17    IBM
  03/10/17    Apple
  03/10/17    Google
  03/10/17    Microsoft
  03/10/17    Lenova
  03/10/17    Nintendo
  03/10/17    Sony
  03/10/17    BMW
  03/10/17    Mercedes
  04/10/17    Toshiba
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>               Stock    Last_index
  02/10/17    IBM 
  02/10/17    Apple   
  02/10/17    Google  
  02/10/17    Microsoft   
  02/10/17    Lenova  
  02/10/17    Nintendo    
  02/10/17    Sony    
  02/10/17    Toshiba 
  03/10/17    IBM         02/10/17
  03/10/17    Apple       02/10/17
  03/10/17    Google      02/10/17
  03/10/17    Microsoft   02/10/17
  03/10/17    Lenova      02/10/17
  03/10/17    Nintendo    02/10/17
  03/10/17    Sony        02/10/17
  03/10/17    BMW 
  03/10/17    Mercedes    
  04/10/17    Toshiba     02/10/17
  </code></pre>
  
  <p>Many thanks.</p>