title: Converting a pandas multi-index series to a dataframe by using second index as columns
body: <p>Hi I have a DataFrame/Series with 2-level multi-index and one column. I would like to take the second-level index and use it as a column. For example (code taken from <a href="https://pandas.pydata.org/pandas-docs/stable/advanced.html#creating-a-multiindex-hierarchical-index-object" rel="noreferrer">multi-index docs</a>):</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  arrays = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
            ['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
  tuples = list(zip(*arrays))
  index = pd.MultiIndex.from_tuples(tuples, names=['first', 'second'])
  s = pd.DataFrame(np.random.randn(8), index=index, columns=["col"])
  </code></pre>
  
  <p>Which looks like:</p>
  
  <pre><code>first  second
  bar    one      -0.982656
         two      -0.078237
  baz    one      -0.345640
         two      -0.160661
  foo    one      -0.605568
         two      -0.140384
  qux    one       1.434702
         two      -1.065408
  dtype: float64
  </code></pre>
  
  <p>What I would like is to have a DataFrame with index <code>[bar, baz, foo, qux]</code> and columns <code>[one, two]</code>.</p>