title: Pandas: break categorical column to multiple columns
body: <p>Imagine a Pandas dataframe of the following format:</p>
  
  <pre><code>id  type  v1  v2
  1   A     6   9
  1   B     4   2
  2   A     3   7
  2   B     3   6
  </code></pre>
  
  <p>I would like to convert this dataframe into the following format:</p>
  
  <pre><code>id  A_v1  A_v2  B_v1  B_v2
  1   6     9     4     2
  2   3     7     3     6
  </code></pre>
  
  <p>Is there an elegant way of doing this?</p>