title: Using df.query() to extract rows from a DataFrame
body: <p>I have a DataFrame <em>df</em> which contain three columns: <code>['mid','2014_amt','2015_amt']</code>  </p>
  
  <p>I want to extract rows of a particular merchant. For example, consider my data is:</p>
  
  <pre><code>df['mid'] = ['as','fsd','qww','fd']
  df['2014_amt] = [144,232,45,121]
  df['2015_amt] = [676,455,455,335]
  </code></pre>
  
  <p>I want to extract the whole rows corresponding to <code>mid = ['fsd','qww']</code> How is this best done? I tried with the below code:</p>
  
  <pre><code>df.query('mid== "fsd"')
  </code></pre>
  
  <p>If I want to run a loop, how can I use the above code to extract rows for specified values of <code>mid</code>?</p>
  
  <pre><code>for val in mid:
             print df.query('mid' == "val"')
  </code></pre>
  
  <p>This is giving an error, as <code>val</code> is not specified.</p>