title: Pandas performing a SQL subtraction between two dataframes
body: <p>I have two dataframes. First there is DF1:</p>
  
  <pre><code>ID      Other value
  1           a
  2           b
  3           c
  </code></pre>
  
  <p>and then there is DF2, which is a subset of DF1:</p>
  
  <pre><code>ID      Other value
  1           a
  </code></pre>
  
  <p>I want to create a third dataframe that would be the equivalent of a minus in SQL: dropping all the observations in the intersection of the two dataframes. This would leave me with DF3:</p>
  
  <pre><code>ID      Other value
  2           b
  3           c
  </code></pre>
  
  <p>I've been trying to use pandasql, but it doesn't seem to like my sql. The code is as follows:
      from pandasql import *
      import pandas as pd</p>
  
  <pre><code>pysqldf = lambda q: sqldf(q, globals())
  train = pysqldf(""" SELECT * FROM DF1 WHERE ID 
                             NOT IN (SELECT ID FROM DF2) """)
  </code></pre>
  
  <p>I get the error </p>
  
  <pre><code>Error on sql  SELECT * FROM DF1 WHERE ID 
                             NOT IN (SELECT ID FROM DF2) 
  </code></pre>
  
  <p>Any ideas on what is going wrong or how I might achieve this quickly using some other pandas functionality. I can do the exact same thing in R with no problems.</p>