title: Pandas Multi-Index DataFrame to Numpy Ndarray
body: <p>I am trying to convert a multi-index pandas <code>DataFrame</code> into a <code>numpy.ndarray</code>.  The DataFrame is below:</p>
  
  <pre><code>               s1  s2   s3   s4
  Action State                   
  1      s1     0.0   0  0.8  0.2
         s2     0.1   0  0.9  0.0
  2      s1     0.0   0  0.9  0.1
         s2     0.0   0  1.0  0.0
  </code></pre>
  
  <p>I would like the resulting <code>numpy.ndarray</code> to be the following with <code>np.shape() = (2,2,4)</code>:</p>
  
  <pre><code>[[[ 0.0  0.0  0.8  0.2 ]
    [ 0.1  0.0  0.9  0.0 ]]
  
   [[ 0.0  0.0  0.9  0.1 ]
    [ 0.0  0.0  1.0  0.0]]]
  </code></pre>
  
  <p>I have tried <code>df.as_matrix()</code> but this returns:</p>
  
  <pre><code> [[ 0.   0.   0.8  0.2]
    [ 0.1  0.   0.9  0. ]
    [ 0.   0.   0.9  0.1]
    [ 0.   0.   1.   0. ]]
  </code></pre>
  
  <p>How do I return a list of lists for the first level with each list representing an <code>Action</code> records.</p>