title: Delete a row if it doesn't contain a specified integer value (Pandas)
body: <p>I have a Pandas dataset that I want to clean up prior to applying my ML algorithm. I am wondering if it was possible to remove a row if an element of its columns does not match a set of values. For example, if I have the dataframe:</p>
  
  <pre><code>    a    b    
  0   1    6    
  1   4    7    
  2   2    4    
  3   3    7    
  ...
  </code></pre>
  
  <p>And I desire the values of <code>a</code> to be one of <code>[1,3]</code> and of <code>b</code> to be one of <code>[6,7]</code>, such that my final dataset is:</p>
  
  <pre><code>    a    b
  0   1    6
  1   3    7
  ...
  </code></pre>
  
  <p>Currently, my implementation is not working as some of my data rows have erroneous strings attached to the value. For example, instead of a value of <code>1</code> I'll have something like <code>1abc</code>. Hence why I would like to remove anything that is not an integer of that value.</p>
  
  <p>My workaround is also a bit archaic, as I am removing entries for column <code>a</code> that do not have 1 or 3 via:</p>
  
  <pre><code>dataset = dataset[(dataset.commute != 1)]
  dataset = dataset[(dataset.commute != 3)]
  </code></pre>