title: Delete rows if combination of two column values is satisfied in python
body: <p>I've below data: I need to delete all rows which have a combination of (ColX='F' and ColY='Y'). 
  I'm trying the below different codes as suggested by below answers. </p>
  
  <ol>
  <li><p>df = df[(df.ColX != 'F')&amp;(df.ColY !='Y')]
  But this code is removing all rows with (ColX=P and ColY=Y) along with (ColX=F and ColY=Y).  I need rows with (ColX=P and ColY=Y) in my data.</p></li>
  <li><p>mask = (df.ColX == 'F') &amp; (df.ColY == 'Y')
    df[~mask]
  This code is not removing any of the rows which I want to remove.</p>
  
  <p>3.mask = (df.ColX == 'F') | (df.ColY == 'Y')
  df[~mask]
  This code is removing all rows with (ColX=P and ColY=Y) along with (ColX=F and ColY=Y).  I need rows with (ColX=P and ColY=Y) in my data.</p></li>
  </ol>
  
  <p>Any inputs are highly appreciated. Thank you!</p>
  
  <pre><code> line_date      ColX       ColY    ColZ   rating        rw    
  
   2007-03-31       P         Y        56     1.000000  56.000000
   2007-03-10       P         Y        67     1.000000  67.000000
   2007-02-10       F         Y        66     1.000000  66.000000
   2007-01-13       2                  83     0.880678  73.096278
   2006-12-23       2         Y        88     0.793033  69.786942
   2006-11-09       F                  52     0.636655  33.106077
   2006-10-22       P                  66     0.581946  38.408408
   2006-09-29       F         Y        70     0.518825  36.317752
  </code></pre>