title: Delete some rows of a column if a value does not exist
body: <p>Given the following DataFrame:</p>
  
  <pre><code>import pandas as pd
  d = pd.DataFrame({'Group':['a','a','c','c'],'Value':[1,1,2,2]})
  print(d)
  
      Group   Value
  0   a       1
  1   a       1
  2   c       2
  3   c       2
  </code></pre>
  
  <p>Since there is no row with a group of 'b', I want to delete any row with a group of 'a'. I only want to delete the 'a' group because there are no rows in the 'b' group.</p>
  
  <p>I know how to get the number of rows in group 'b' like this:</p>
  
  <pre><code>len(d.loc[d['Group']=='b'])
  </code></pre>
  
  <p>and then do this:</p>
  
  <pre><code>if len(d.loc[d['Group']=='b'])==0:
      d=d.loc[d['Group']!='a']
  print(d)
  
      Group   Value
  2   c       2
  3   c       2
  </code></pre>
  
  <p>...but I'm wondering how to work it into the .loc method in one line.</p>
  
  <p>Thanks in advance!</p>