title: How to pivot_table with with duplicated index
body: <p>I have a df_ like this,</p>
  
  <pre><code>name  level  status
  yes   high   open
  no    high   closed
  no    med    closed
  yes   low    open
  no    med    rejected
  no    high   open
  </code></pre>
  
  <p>I am trying to create a pivot table with <code>index='level',columns='status', values=sum of occurances with respect to the column and index</code></p>
  
  <p>my code:</p>
  
  <pre><code>df_['temp']=df_['level'].astype(bool).astype(int)
  df_.pivot(index='level',columns='status',values='temp')
  </code></pre>
  
  <p>but gives me, <code>ValueError: Index contains duplicate entries, cannot reshape
  </code></p>
  
  <p>My expected output is,</p>
  
  <pre><code>      open closed rejected
  high  2    1      0
  med   0    1      1
  low   1    0      0
  </code></pre>
  
  <p>Please check and tell me if there is any other easy way.</p>