title: Can I check if multiple values are in a pandas column?
body: <p>I'm trying to check if all my expected values are in pandas dataframe. The expected values are known ahead of time and the dataframe is automatically generated from a database query.</p>
  
  <p>This is an example of what I'm trying to do</p>
  
  <pre><code>import pandas as pd
  import StringIO
  
  expected_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  csv = StringIO.StringIO("""ExpectedID,Random Value
  1,val1
  2,val2
  3,val3
  8,val8
  9,val9
  10,val10
  """)
  df = pd.read_csv(csv, sep=",")
  
  for e in expected_ids:
      if e not in df['ExpectedID']:
          print "Missing: ", e
  </code></pre>
  
  <p>My problem is that I have to check each value I'm expecting individually and in my real code there are approximately 14000 of these. I'd also like to pull the missing ones into another dataframe that I can manipulate later but don't know how to do that.</p>
  
  <p>The other problem I have is that the above prints this:</p>
  
  <pre><code>Missing:  6
  Missing:  7
  Missing:  8
  Missing:  9
  Missing:  10
  </code></pre>
  
  <p>Those values aren't all correct. I am missing 6 and 7, but 8, 9, and 10 are in the df. It also doesn't say that 4 and 5 are missing.</p>
  
  <p>How can I accurately check if multiple values are in a dataframe column?</p>