title: reshape a pandas dataframe index to columns
body: <p>Consider the below pandas Series object,</p>
  
  <pre><code>index = list('abcdabcdabcd')
  df = pd.Series(np.arange(len(index)), index = index)
  </code></pre>
  
  <p>My desired output is,</p>
  
  <pre><code>   a  b   c   d
  0  0  1   2   3
  1  4  5   6   7
  2  8  9  10  11
  </code></pre>
  
  <p>I have put some effort with pd.pivot_table, pd.unstack and probably the solution lies with correct use of one of them. The closest i have reached is </p>
  
  <pre><code>df.reset_index(level = 1).unstack(level = 1)
  </code></pre>
  
  <p>but this does not gives me the output i my looking for</p>
  
  <p>// here is something even closer to the desired output, but i am not able to handle the index grouping. </p>
  
  <pre><code>df.to_frame().set_index(df1.values, append = True, drop  = False).unstack(level = 0)
  
       a    b     c     d
  0   0.0  NaN   NaN   NaN
  1   NaN  1.0   NaN   NaN
  2   NaN  NaN   2.0   NaN
  3   NaN  NaN   NaN   3.0
  4   4.0  NaN   NaN   NaN
  5   NaN  5.0   NaN   NaN
  6   NaN  NaN   6.0   NaN
  7   NaN  NaN   NaN   7.0
  8   8.0  NaN   NaN   NaN
  9   NaN  9.0   NaN   NaN
  10  NaN  NaN  10.0   NaN
  11  NaN  NaN   NaN  11.0
  </code></pre>