title: Remove rows from pandas DataFrame using multiple criteria
body: <p>I am trying to remove rows from a pandas DataFrame with multiple criteria. </p>
  
  <p>The criteria is if Trader_x buys and sells on the same date, remove both the buy and sell rows for that date.</p>
  
  <p>This is complex because it requires the trader and date to be unique for the lookup. I do not want to remove rows if only the date matches buy and sell. It has to be trader_x and date dependant.</p>
  
  <p>I have tried many methods including pivot tables and merges but I cannot get anything close to working.</p>
  
  <p>The input data looks like this:</p>
  
  <pre><code>Trader_ID   Date    Type
  Trader_1    5/4/11  Sell
  Trader_1    13/4/11 Sell
  Trader_1    4/4/12  Sell
  Trader_1    3/4/13  Sell
  Trader_1    2/5/13  Sell
  Trader_1    9/7/13  Sell
  Trader_1    5/5/14  Buy
  Trader_1    5/5/14  Sell
  Trader_1    5/5/15  Buy
  Trader_2    5/5/15  Sell
  Trader_2    15/3/13 Buy
  Trader_2    15/3/13 Sell
  Trader_2    1/4/13  Buy
  Trader_2    1/4/13  Sell
  Trader_2    15/4/13 Buy
  Trader_2    15/4/13 Sell
  Trader_2    29/4/13 Buy
  Trader_2    30/4/13 Sell
  Trader_2    22/5/13 Sell
  </code></pre>
  
  <p>Example DataFrame below if anyone is willing to try.</p>
  
  <pre><code>data = {'trader_id': ['Trader_1','Trader_1','Trader_1','Trader_1','Trader_1','Trader_1','Trader_1',
        'Trader_1','Trader_1','Trader_2','Trader_2','Trader_2','Trader_2','Trader_2','Trader_2',
        'Trader_2','Trader_2','Trader_2','Trader_2'],
       'date': ['1/4/13', '13/4/11', '4/4/12', '3/4/13', '2/5/13', '9/7/13', '5/5/14', '5/5/14', '5/5/15',
        '5/5/15', '15/3/13', '15/3/13', '1/4/13', '1/4/13', '15/4/13', '15/4/13', '29/4/13', '30/4/13', '22/5/13'],
         'type': ['Sell', 'Sell', 'Sell', 'Sell', 'Sell', 'Sell', 'Buy', 'Sell', 'Buy', 'Sell', 'Buy', 
                  'Sell', 'Buy', 'Sell', 'Buy', 'Sell', 'Buy', 'Sell', 'Sell']}
  
  df = pd.DataFrame(data)
  </code></pre>
  
  <p>The (example) dataset has a total input of 19 rows. The output should only have 11 rows.</p>
  
  <p>The output data should look like this:</p>
  
  <pre><code>Trader_ID   Date    Type
  Trader_1    5/4/11  Sell
  Trader_1    13/4/11 Sell
  Trader_1    4/4/12  Sell
  Trader_1    3/4/13  Sell
  Trader_1    2/5/13  Sell
  Trader_1    9/7/13  Sell
  Trader_1    5/5/15  Buy
  Trader_2    5/5/15  Sell
  Trader_2    29/4/13 Buy
  Trader_2    30/4/13 Sell
  Trader_2    22/5/13 Sell
  </code></pre>
  
  <p>Would love some guidance on this one - I'm stuck. Thanks.</p>