title: find rows in pd.df based on complicated condition
body: <p>My df looks like this:</p>
  
  <pre><code>                    code       date type  strike  settlement
  id                                                          
  1195001   CBT_21_G2012_S 2012-01-04    P  101.50    0.015625
  1195093   CBT_21_G2012_S 2012-01-04    C  101.50   28.890625
  1194926   CBT_21_G2012_S 2012-01-04    C  102.00   28.390625
  1194944   CBT_21_G2012_S 2012-01-04    C  102.50   27.906250
  1195109   CBT_21_G2012_S 2012-01-04    P  102.50    0.015625
  1194905   CBT_21_G2012_S 2012-01-04    C  103.00   27.406250
  1195008   CBT_21_G2012_S 2012-01-04    P  103.50    0.015625
  1195123   CBT_21_G2012_S 2012-01-04    C  103.50   26.906250
  1194908   CBT_21_G2012_S 2012-01-04    C  104.00   26.390625
  1194980   CBT_21_G2012_S 2012-01-04    C  104.50   25.890625
  1195025   CBT_21_G2012_S 2012-01-04    P  104.50    0.015625
  1194981   CBT_21_G2012_S 2012-01-04    P  105.00    0.015625
  1195063   CBT_21_G2012_S 2012-01-04    C  105.00   25.390625
  1194960   CBT_21_G2012_S 2012-01-04    C  105.50   24.890625
  1195102   CBT_21_G2012_S 2012-01-04    P  105.50    0.015625
  1194989   CBT_21_G2012_S 2012-01-04    C  106.00   24.390625
  </code></pre>
  
  <p>I need to find rows where there is only type=='P' or type=='C' for the same code, date and strike. </p>
  
  <p>The desired output should be:</p>
  
  <pre><code>                    code       date type  strike  settlement
  id                                                          
  1194926   CBT_21_G2012_S 2012-01-04    C  102.00   28.390625
  1194905   CBT_21_G2012_S 2012-01-04    C  103.00   27.406250
  1194908   CBT_21_G2012_S 2012-01-04    C  104.00   26.390625
  1194989   CBT_21_G2012_S 2012-01-04    C  106.00   24.390625
  </code></pre>
  
  <p>[Edit]
  Also how can I flip 'type' 'C' and 'P' in the resulting df (replace 'C' with 'P' and 'P' with 'C')?</p>
  
  <p>Any help would be hugely apppreciated.</p>
  
  <p>Thanks in advance.</p>