title: Python Pandas - Removing Rows From A DataFrame Based on a Previously Obtained Subset
body: <p>I'm running <code>Python 2.7</code> with the <code>Pandas 0.11.0</code> library installed.</p>
  
  <p>I've been looking around a haven't found an answer to this question, so I'm hoping somebody more experienced than I has a solution.</p>
  
  <p>Lets say my data, in df1, looks like the following:</p>
  
  <p><code>df1=</code></p>
  
  <pre><code>  zip  x  y  access
    123  1  1    4
    123  1  1    6
    133  1  2    3
    145  2  2    3
    167  3  1    1
    167  3  1    2
  </code></pre>
  
  <p>Using, for instance, <code>df2 = df1[df1['zip'] == 123]</code> and then <code>df2 = df2.join(df1[df1['zip'] == 133])</code> I get the following subset of data:</p>
  
  <p><code>df2=</code></p>
  
  <pre><code> zip  x  y  access
   123  1  1    4
   123  1  1    6
   133  1  2    3
  </code></pre>
  
  <p>What I want to do is either:</p>
  
  <p>1) Remove the rows from <code>df1</code> as they are defined/joined with <code>df2</code></p>
  
  <p>OR</p>
  
  <p>2) After <code>df2</code> has been created, remove the rows (difference?) from <code>df1</code> which <code>df2</code> is composed of</p>
  
  <p>Hope all of that makes sense.  Please let me know if any more info is needed.</p>
  
  <p>EDIT:</p>
  
  <p>Ideally a third dataframe would be create that looks like this:</p>
  
  <p><code>df2=</code></p>
  
  <pre><code> zip  x  y  access
   145  2  2    3
   167  3  1    1
   167  3  1    2
  </code></pre>
  
  <p>That is, everything from <code>df1</code> not in <code>df2</code>.  Thanks!</p>