title: Remove a level from a MultiIndex
body: <p>I need to remove a level (either by position or name) from a DataFrame's index and create a new DataFrame with the new index. The problem is that I end up having a non-unique index.</p>
  
  <p>I had a look at <a href="https://stackoverflow.com/questions/17471682/remove-a-level-from-a-pandas-multiindex">Remove a level from a pandas MultiIndex</a> but the problem is that the use of unique(), as the answer in there suggests, reduces the index to an array, that doesn't retain the names of the levels.</p>
  
  <p>Other than using unique(), and then creating a new Index by stitching the label names onto the array, is there a more elegant solution?</p>
  
  <pre><code>index = [np.array(['foo', 'foo', 'qux']), np.array(['a', 'b', 'a'])]
  data = np.random.randn(3, 2)
  columns = ["X", "Y"]
  df = pd.DataFrame(data, index=index, columns=columns)
  df.index.names = ["Level0", "Level1"]
  print df
  
                        X         Y
  Level0 Level1                    
  foo    a      -0.591649  0.831599
         b       0.049961 -1.524291
  qux    a      -0.100124 -1.059195
  
  index2 = df.reset_index(level=1, drop=True).index
  df2 = pd.DataFrame(index=index2)
  print df2.loc[idx['foo'], :]
  
  Empty DataFrame
  Columns: []
  Index: [foo, foo]
  </code></pre>