title: How to convert a pandas MultiIndex DataFrame into a 3D array
body: <p>Suppose I have a MultiIndex DataFrame:</p>
  
  <pre><code>                                c       o       l       u
  major       timestamp                       
  ONE         2019-01-22 18:12:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:13:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:14:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:15:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:16:00 0.00008 0.00008 0.00008 0.00008
  
  TWO         2019-01-22 18:12:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:13:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:14:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:15:00 0.00008 0.00008 0.00008 0.00008 
              2019-01-22 18:16:00 0.00008 0.00008 0.00008 0.00008
  </code></pre>
  
  <p>I want to generate a NumPy array from this DataFrame with a 3-dimensional, given the dataframe has 15 categories in the major column, 4 columns and one time index of length 5. I would like to create a numpy array with a shape of <strong>(4,15,5)</strong> denoting <strong>(columns, categories, time_index)</strong> respectively.</p>
  
  <p>should create an array:</p>
  
  <pre><code>array([[[8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05],
          [8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05]],
  
         [[8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05],
          [8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05]],
  
         [[8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05],
          [8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05]],
  
         [[8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05],
          [8.e-05, 8.e-05, 8.e-05, 8.e-05, 8.e-05]]])
  </code></pre>
  
  <p>One used to be able to do this with pd.Panel:</p>
  
  <pre><code>panel = pd.Panel(items=[columns], major_axis=[categories], minor_axis=[time_index], dtype=np.float32)
  ... 
  </code></pre>
  
  <p><strong>How would I be able to most effectively accomplish this with a multi index dataframe?</strong>
  <strong>Thanks</strong></p>