title: Selecting rows from pandas DataFrame using two columns
body: <p>I have a DataFrame in pandas that I'd like to select a subset of rows from based on the values of two columns.  </p>
  
  <pre><code>test_df = DataFrame({'Topic' : ['A','A','A','B','B'], 'Characteristic' : ['Population','Other','Other','Other','Other'], 'Total' : [25, 22, 21, 20, 30]})
  </code></pre>
  
  <p>It works as expected and returns the first row when I use this code:</p>
  
  <pre><code>bool1 = test_df['Topic']=='A' 
  bool2 = test_df['Characteristic']=='Population'
  
  test_df[bool1 &amp; bool2]
  </code></pre>
  
  <p>But when I try to do it all in one line as below, </p>
  
  <pre><code>test_df[test_df['Topic']=='A' &amp; test_df['Characteristic']=='Population']
  </code></pre>
  
  <p>I get "TypeError: cannot compare a dtyped [object] array with a scalar of type [bool]"</p>
  
  <p>Why?  Is there a good way to do this in a single step?</p>