title: Efficiently select rows that match one of several values in Pandas DataFrame
body: <h2>Problem</h2>
  
  <p>Given data in a Pandas DataFrame like the following:</p>
  
  <pre><code>Name     Amount
  ---------------
  Alice       100
  Bob          50
  Charlie     200
  Alice        30
  Charlie      10
  </code></pre>
  
  <p>I want to select all rows where the <code>Name</code> is one of several values in a collection <code>{Alice, Bob}</code></p>
  
  <pre><code>Name     Amount
  ---------------
  Alice       100
  Bob          50
  Alice        30
  </code></pre>
  
  <h2>Question</h2>
  
  <p>What is an efficient way to do this in Pandas?</p>
  
  <p>Options as I see them</p>
  
  <ol>
  <li>Loop through rows, handling the logic with Python</li>
  <li><p>Select and merge many statements like the following </p>
  
  <pre><code>merge(df[df.name = specific_name] for specific_name in names) # something like this
  </code></pre></li>
  <li><p>Perform some sort of join</p></li>
  </ol>
  
  <p>What are the performance trade-offs here?  When is one solution better than the others?  What solutions am I missing?</p>
  
  <p>While the example above uses strings my actual job uses matches on 10-100 integers over millions of rows and so fast NumPy operations may be relevant. </p>