title: Fast pandas filtering
body: <p>I want to filter a pandas dataframe, if the name column entry has an item in a given list.</p>
  
  <p>Here we have a DataFrame</p>
  
  <pre><code>x = DataFrame(
      [['sam', 328], ['ruby', 3213], ['jon', 121]], 
      columns=['name', 'score'])
  </code></pre>
  
  <p>Now lets say we have a list, <code>['sam', 'ruby']</code> and we want to find all rows where the name is in the list, then sum the score.</p>
  
  <p>The solution I have is as follows:</p>
  
  <pre><code>total = 0
  names = ['sam', 'ruby']
  for name in names:
       identified = x[x['name'] == name]
       total = total + sum(identified['score'])
  </code></pre>
  
  <p>However when the dataframe gets extremely large, and the list of names gets very large too, everything is very very slow. </p>
  
  <p>Is there any faster alternative?</p>
  
  <p>Thanks</p>