title: How to filter rows of Pandas dataframe by checking whether sub-level index value within a list?
body: <p>I have a sample Pandas dataframe <code>df</code> which has multi_level index:</p>
  
  <pre><code>&gt;&gt;&gt; df
                  STK_Name   ROIC   mg_r
  STK_ID RPT_Date                       
  002410 20111231      ???  0.401  0.956
  300204 20111231      ???  0.375  0.881
  300295 20111231     ????  2.370  0.867
  300288 20111231     ????  1.195  0.861
  600106 20111231     ????  1.214  0.857
  300113 20111231     ????  0.837  0.852
  </code></pre>
  
  <p>and <code>stk_list</code> is defined as <code>stk_list = ['600106','300204','300113']</code></p>
  
  <p>I want to get the rows of <code>df</code> whose value of sub_level index <code>STK_ID</code> is within <code>stk_list</code> . The output is as below:</p>
  
  <pre><code>                STK_Name   ROIC   mg_r
  STK_ID RPT_Date                       
  300204 20111231      ???  0.375  0.881
  600106 20111231     ????  1.214  0.857
  300113 20111231     ????  0.837  0.852
  </code></pre>
  
  <p>Basically, I can achieve the target for this sample data by: </p>
  
  <pre><code>df = df.reset_index() ; df[df.STK_ID.isin(stk_list)]
  </code></pre>
  
  <p>But I already have columns 'STK_ID' &amp; 'RPT_Date' in my application dataframe, so reset_index() will cause an error. Anyway, I want to directly filter against index instead of columns.</p>
  
  <p>Learn from this : <a href="https://stackoverflow.com/questions/12224778/how-to-filter-by-sub-level-index-in-pandas">How to filter by sub-level index in Pandas</a></p>
  
  <p>I try <code>df[df.index.map(lambda x: x[0].isin(stk_list))]</code> , and Pandas 0.8.1 gives <code>AttributeError: 'unicode' object has no attribute 'isin'</code>,</p>
  
  <p>My question:  How should I filter rows of Pandas dataframe by checking whether sub-level index value within a list without using the <code>reset_index()</code> &amp; <code>set_index()</code> methods?</p>