title: How to use pandas to shift the last row to the first
body: <p>So I have a dataframe that looks like this:</p>
  
  <pre><code>                         #1                     #2
  1980-01-01               11.6985                126.0
  1980-01-02               43.6431                134.0
  1980-01-03               54.9089                130.0
  1980-01-04               63.1225                126.0
  1980-01-05               72.4399                120.0
  </code></pre>
  
  <p>What I want to do is to shift the first row of the first column (11.6985) down 1 row, and then the last row of the first column (72.4399) would be shifted to the first row, first column, like so:</p>
  
  <pre><code>                         #1                     #2
  1980-01-01               72.4399                126.0
  1980-01-02               11.6985                134.0
  1980-01-03               43.6431                130.0
  1980-01-04               54.9089                126.0
  1980-01-05               63.1225                120.0
  </code></pre>
  
  <p>The idea is that I want to use these dataframes to find an R^2 value for every shift, so I need to use all the data or it might not work. I have tried to use <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.shift.html" rel="noreferrer">pandas.Dataframe.shift()</a>:</p>
  
  <pre><code>print(data)
  
  #Output
  1980-01-01               11.6985                126.0
  1980-01-02               43.6431                134.0
  1980-01-03               54.9089                130.0
  1980-01-04               63.1225                126.0
  1980-01-05               72.4399                120.0
  
  print(data.shift(1,axis = 0))
  
  1980-01-01                   NaN                  NaN
  1980-01-02               11.6985                126.0
  1980-01-03               43.6431                134.0
  1980-01-04               54.9089                130.0
  1980-01-05               63.1225                126.0
  </code></pre>
  
  <p>So it just shifts both columns down and gets rid of the last row of data, which is not what I want.</p>
  
  <p>Any advice?</p>