title: convert rows to columns in pandas dataframe
body: <p>I'd like to convert to below <code>Df1</code> to <code>Df2</code>. </p>
  
  <p>The empty values would be filled with <code>Nan</code>.  </p>
  
  <p>Below Dfs are examples.   </p>
  
  <ul>
  <li>My data has weeks from 1 to 8.  </li>
  <li><p>IDs are 100,000.</p></li>
  <li><p>Only week 8 has all IDs, so total rows will be 100,000.  </p></li>
  </ul>
  
  <p>I have Df3 which has 100,000 of id, and I want to merge df1 on Df3 formatted as df2.</p>
  
  <p>ex) <code>pd.merge(df3, df1, on="id", how="left")</code> -> but, formatted as <code>df2</code></p>
  
  <pre><code> Df1&gt;
   wk, id, col1, col2  ...
   1    1   0.5  15  
   2    2   0.5  15  
   3    3   0.5  15  
   1    2   0.5  15  
   3    2   0.5  15  
  
   ------
   Df2&gt;
   wk1, id, col1, col2, wk2, id, col1, col2, wk3,  id, col1, col2,...
   1    1   0.5  15      2    1   Nan   Nan   3    1   Nan   Nan
   1    2   0.5  15      2    2   0.5  15     3    2   0.5    15
   1    3   Nan  Nan     2    3   Nan   Nan   3    3   0.5    15
  </code></pre>