title: Pandas KeyError using pivot
body: <p>I'm new to Python and I would like to use Python to replicate a common excel task. If such a question has already been answered, please let me know.  I've been unable to find it.   I have the following pandas dataframe (data):</p>
  <pre><code>Date    Stage   SubStage    Value
  12/31/2015   1.00   a   0.896882891
  1/1/2016     1.00   a   0.0458843
  1/2/2016     1.00   a   0.126805588
  1/3/2016     1.00   b   0.615824461
  1/4/2016     1.00   b   0.245092069
  1/5/2016     1.00   c   0.121936318
  1/6/2016     1.00   c   0.170198128
  1/7/2016     1.00   c   0.735872415
  1/8/2016     1.00   c   0.542361912
  1/4/2016     2.00   a   0.723769247
  1/5/2016     2.00   a   0.305570257
  1/6/2016     2.00   b   0.47461605
  1/7/2016     2.00   b   0.173702623
  1/8/2016     2.00   c   0.969260251
  1/9/2016     2.00   c   0.017170798
  </code></pre>
  <p>In excel, I can use a pivot table to produce the following:</p>
  <p><a href="https://i.stack.imgur.com/Q2yTu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q2yTu.png" alt="excel pivot table using 'data'" /></a></p>
  <p>It seems reasonable to do the following in python:</p>
  <pre><code>data.pivot(index='Date',
             columns=['Stage', 'SubStage'],
             values='Value')
  </code></pre>
  <p>But that produces:</p>
  <pre><code>KeyError: 'Level Stage not found'
  </code></pre>
  <p>What gives?</p>