title: Sorting Multi-Index to full depth (Pandas)
body: <p>I have a dataframe which Im loading from a csv file and then setting the index to few of its columns (usually two or three) by the <code>set_index</code> method. The idea is to then access parts of the dataframe using several key combination, as such:</p>
  
  <pre><code>df.set_index(['fileName','phrase'])
  df.ix['somePath','somePhrase']
  </code></pre>
  
  <p>Apparently, this type of selection with multiple keys is only possible if the <code>MultiIndex</code> of the dataframe is sorted to sufficient depth. In this case, since im supplying two keys, the <code>.ix</code> operation will not fail only if the dataframe <code>MultiIndex</code> is sorted to depth of at least 2. </p>
  
  <p>for some reason, when Im setting the index as shown, while to me it seems both layers are sorted, calling  <code>df.index.lexsort_depth</code> command returns <code>1</code> , and I get the following error when trying to access with two keys:</p>
  
  <blockquote>
    <p>MultiIndex lexsort depth 1, key was length 2</p>
  </blockquote>
  
  <p>Any help?</p>