title: Pandas: convert upper triangular dataframe by shifting rows to the left
body: <p>I have a dataframe that looks "upper-triangular":</p>
  
  <pre><code>            31-May-11  30-Jun-11  31-Jul-11  31-Aug-11  30-Sep-11  31-Oct-11
  OpenDate
  2011-05-31  68.432797  81.696071  75.083249  66.659008  68.898034  72.622304
  2011-06-30        NaN   1.711097   1.501082   1.625213   1.774645   1.661183
  2011-07-31        NaN        NaN   0.422364   0.263561   0.203572   0.234376
  2011-08-31        NaN        NaN        NaN   1.077009   1.226946   1.520701
  2011-09-30        NaN        NaN        NaN        NaN   0.667091   0.495993
  </code></pre>
  
  <p>and I would like to convert it by shifting the <code>i</code>th row to the left by <code>i-1</code>:</p>
  
  <pre><code>            31-May-11  30-Jun-11  31-Jul-11  31-Aug-11  30-Sep-11  31-Oct-11
  OpenDate
  2011-05-31  68.432797  81.696071  75.083249  66.659008  68.898034  72.622304
  2011-06-30  1.711097   1.501082   1.625213   1.774645   1.661183   NaN
  2011-07-31  0.422364   0.263561   0.203572   0.234376   NaN        NaN
  2011-08-31  1.077009   1.226946   1.520701   NaN        NaN        NaN
  2011-09-30  0.667091   0.495993   NaN        NaN        NaN        NaN   
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I can't exclude that there might be NaNs present in the upper part of the matrix, so we migth see something like this:</p>
  
  <pre><code>            31-May-11  30-Jun-11  31-Jul-11  31-Aug-11  30-Sep-11  31-Oct-11
  OpenDate
  2011-05-31  68.432797  81.696071  75.083249  66.659008  68.898034  72.622304
  2011-06-30        NaN        NaN   1.501082   1.625213   1.774645   1.661183
  2011-07-31        NaN        NaN   0.422364   0.263561   0.203572   0.234376
  2011-08-31        NaN        NaN        NaN   1.077009   1.226946   1.520701
  2011-09-30        NaN        NaN        NaN        NaN   0.667091   0.495993
  </code></pre>
  
  <p>which should be turned into </p>
  
  <pre><code>            31-May-11  30-Jun-11  31-Jul-11  31-Aug-11  30-Sep-11  31-Oct-11
  OpenDate
  2011-05-31  68.432797  81.696071  75.083249  66.659008  68.898034  72.622304
  2011-06-30  NaN        1.501082   1.625213   1.774645   1.661183   NaN
  2011-07-31  0.422364   0.263561   0.203572   0.234376   NaN        NaN
  2011-08-31  1.077009   1.226946   1.520701   NaN        NaN        NaN
  2011-09-30  0.667091   0.495993   NaN        NaN        NaN        NaN   
  </code></pre>
  
  <p>Any ideas how to achieve this?</p>
  
  <p>Thanks,
  Anne</p>