title: Pandas pivot_table preserve order
body: <pre><code>&gt;&gt;&gt; df
     A   B   C      D
  0  foo one small  1
  1  foo one large  2
  2  foo one large  2
  3  foo two small  3
  4  foo two small  3
  5  bar one large  4
  6  bar one small  5
  7  bar two small  6
  8  bar two large  7
  &gt;&gt;&gt; table = pivot_table(df, values='D', index=['A', 'B'],
  ...                     columns=['C'], aggfunc=np.sum)
  &gt;&gt;&gt; table
            small  large
  foo  one  1      4
       two  6      NaN
  bar  one  5      4
       two  6      7
  </code></pre>
  
  <p>I want the output to be as shown above, but I get a sorted output.
  bar comes above foo and so on.</p>