title: Pandas pivot with duplicates
body: <p>The sample data looks like this:</p>
  
  <pre><code>d = pd.DataFrame({'name': ['Adam', 'Adam', 'Bob', 'Bob', 'Craig'],
                'number': [111, 222, 333, 444, 555], 
                'type': ['phone', 'fax', 'phone', 'phone', 'fax']})
  
  name    number  type
  ------   ------  -----
  Adam    111     phone
  Adam    222     fax
  Bob     333     phone
  Bob     444     phone
  Craig   555     fax
  </code></pre>
  
  <p>I am trying to convert the numbers (phone and fax) to a wide format, the ideal output:</p>
  
  <pre><code>name    fax     phone
  ----    -----   -----
  Adam    222.0   111.0
  Bob     NaN     333.0
  Bob     NaN     444.0
  Craig   555.0   NaN
  </code></pre>
  
  <p>When I tried to use the <code>pivot</code> method and run the following code:</p>
  
  <pre><code>p = d.pivot(index='name', columns = 'type', values='number').reset_index()
  </code></pre>
  
  <p>I received the error <code>ValueError: Index contains duplicate entries, cannot reshape</code> due to the fact that Bob has two phone numbers.</p>
  
  <p>Is there a workaround for this?</p>