title: Error: None of [Index(['...'], dtype='object')] are in the [index]
body: <p>I am trying to delete a grouped set of rows in pandas according to the following condition:</p>
  
  <p>If a group (grouped by col1) has more than 2 values 'c' in col2, then remove the whole group.</p>
  
  <p>What I have looks like this</p>
  
  <pre><code>  col1  col2                       
  0  A     10:10 
  1  A     20:05
  2  A     c
  3  A     00:10
  4  B     04:15
  2  B     c
  3  B     c
  4  B     13:40
  </code></pre>
  
  <p>And I am trying to get here:</p>
  
  <pre><code>  col1  col2                       
  0  A     10:10 
  1  A     20:05
  2  A     c
  3  A     00:10
  </code></pre>
  
  <p>Typically I do this for other very similar dataframes (and it works):</p>
  
  <pre><code>df = df.groupby('col1').filter(lambda x: x["col2"].value_counts()[['c']].sum() &lt; 2)
  </code></pre>
  
  <p>But for this one is not working and I receive this error:</p>
  
  <pre><code>KeyError: "None of [Index(['c'], dtype='object')] are in the [index]"
  </code></pre>
  
  <p>Does someone have an idea on how I could do this?</p>
  
  <p>Thanks!</p>