title: How do I filter categorical data in Pandas
body: <p>Here is the information of the data</p>
  <pre><code>    sex     age         race        
      Male    0.204082    Hispanic    
      Male    0.122449    African-American    
      Female  0.163265    African-American    
      Male    0.081633    African-American    
      Male    0.530612    African-American
  </code></pre>
  <pre><code>African-American    2968
  Caucasian           1969
  Hispanic             502
  Other                294
  Asian                 26
  Native American       13
  Name: race, dtype: int64 
  </code></pre>
  <p>I want to basically remove Native American and Asian from the dataset, and this is what I did:</p>
  <pre><code>df_train_val_scaled = df_train_val_scaled[df_train_val_scaled[&quot;race&quot;] != &quot;Native American&quot; &amp; df_train_val_scaled[&quot;race&quot;] != &quot;Asian&quot;]
  </code></pre>
  <p>which produced the following error:</p>
  <pre><code>TypeError: Cannot perform 'rand_' with a dtyped [object] array and scalar of type [bool]
  </code></pre>
  <p>So I tried the following</p>
  <pre><code>df_train_val_scaled = df_train_val_scaled[df_train_val_scaled[&quot;race&quot;] not in [&quot;Native American&quot;, &quot;Asian&quot;]]
  </code></pre>
  <p>But it also produces errors</p>
  <pre><code>ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>
  <p>Thanks for any help</p>