title: A faster alternative to Pandas `isin` function
body: <p>I have a very large data frame <code>df</code> that looks  like:</p>
  
  <pre><code>ID       Value1    Value2
  1345      3.2      332
  1355      2.2      32
  2346      1.0      11
  3456      8.9      322
  </code></pre>
  
  <p>And I have a list that contains a subset of IDs <code>ID_list</code>. I need to have a subset of <code>df</code> for the <code>ID</code> contained in <code>ID_list</code>. </p>
  
  <p>Currently, I am using <code>df_sub=df[df.ID.isin(ID_list)]</code> to do it. But it takes a lot time. <code>ID</code>s contained in <code>ID_list</code> doesn't have any pattern, so it's not within certain range. (And I need to apply the same operation to many similar dataframes. I was wondering if there is any faster way to do this. Will it help a lot if make <code>ID</code> as the index? </p>
  
  <p>Thanks!</p>