title: how to reshape dataframe in python pandas
body: <p>Can anyone suggest an efficient way of reshaping a column (in a python pandas dataframe) into multiple columns, with alternating column assignment. I could do this with a loop but wondering if there is a more elegant way. For an example, consider the following example:</p>
  <pre><code>Col
  1 
  2  
  3  
  4  
  5  
  6 
  7  
  8  
   
  </code></pre>
  <p>to</p>
  <pre><code>x1 x2 x3
  1 2 3
  2 3 4
  3 4 5
  4 5 6
  5 6 7
  6 7 8
  </code></pre>