title: Index is out of bounds when using .pivot
body: <p>I have a dataframe with size (2481430, 2) and I want to group by columns B with no summarization for column codex.</p>
  
  <p>I used .pivot and it returned 'index 2025068794 is out of bounds for axis 0 with size 2024681638'</p>
  
  <pre><code>   codex    B
  0  D0003    20
  1  D0004    21
  2  D0003    21
  3  D0001    20
  4  D0002    20
  5  D0005    20
  
  
  df.pivot(columns = 'B', values = 'codex')
  </code></pre>
  
  <p>This the expected result</p>
  
  <pre><code>   20       21
  0  D0003    D0004
  1  D0001    D0003
  2  D0002    NaN
  3  D0005    NaN
  </code></pre>