title: Creating Multi-level pandas dataframe
body: <p>I am trying to create a hierarchical dataframe based on a dataframe that I have. I have managed to create a multi index dataframe as follows:</p>
  <p><a href="https://i.stack.imgur.com/XeOmI.png" rel="nofollow noreferrer">Image of dataframe structure</a></p>
  <p>So my dataframe index is the following:</p>
  <pre><code>MultiIndex([('x',    'yellow'),
              ('x',      'blue'),
              ('x',     'green'),
              ('x',     'white'),
              ('x',     'ind10'),
              ('x',       'red'),
              ('x', 'turquoise'),
              ('x',     'black'),
              ('x',    'purple'),
              ('x',    'orange'),
              ('x',     'ind11'),
              ('y',    'yellow'),
              ('y',      'blue'),
              ('y',     'green'),
              ('y',     'white'),
              ('y',     'ind10'),
              ('y',       'red'),
              ('y', 'turquoise'),
              ('y',     'black'),
              ('y',    'purple'),
              ('y',    'orange'),
              ('y',     'ind11')],
             )
  </code></pre>
  <p>Now I am trying to convert this into something with the following structure:</p>
  <pre><code>yellow  x   ........
          y   ........
  orange  x   ........
          y   ........
  .
  .
  .
  ind11   x   ........
          y   ........
  </code></pre>
  <p>But I can't seem to do this. I have tried various forms of <code>pd.MultiIndex.from_frame</code> but to no avail.</p>
  <p>Any help would be greatly appreciated</p>