Shift pandas dataframe down in a cyclical manner
<p>If we have the following data:</p>

<pre><code>X = pd.DataFrame({"t":[1,2,3,4,5],"A":[34,12,78,84,26], "B":[54,87,35,25,82], "C":[56,78,0,14,13], "D":[0,23,72,56,14], "E":[78,12,31,0,34]})
X

    A   B   C   D   E  t
0  34  54  56   0  78  1
1  12  87  78  23  12  2
2  78  35   0  72  31  3
3  84  25  14  56   0  4
4  26  82  13  14  34  5 
</code></pre>

<p>How can I shift the data in a cyclical fashion so that the next step is:</p>

<pre><code>    A   B   C   D   E  t
4  26  82  13  14  34  5 
0  34  54  56   0  78  1
1  12  87  78  23  12  2
2  78  35   0  72  31  3
3  84  25  14  56   0  4
</code></pre>

<p>And then:</p>

<pre><code>    A   B   C   D   E  t
3  84  25  14  56   0  4
4  26  82  13  14  34  5 
0  34  54  56   0  78  1
1  12  87  78  23  12  2
2  78  35   0  72  31  3
</code></pre>

<p>etc. </p>

<p>This should also shift the index values with the row. </p>

<p>I know of pandas X.shift(), but it wasn't making the cyclical thing.</p>