title: Check for Uniqueness of Series in Groupby Object Pandas
body: <p>I'm struggling with how to get <code>transform()</code> to return my desired result. I would like to check if in each group whether 'missed' is unique in a given group.</p>
  
  <p>Consider the follow:</p>
  
  <pre><code>df = pd.DataFrame({'key': [1, 1, 2, 2, 3, 3, 2, 4], 'type': ['correct', 'incorrect', 'missed', 'incorrect', 'missed', 'missed', 'correct', 'pass']})
  df
  
    key   type
  0   1   correct
  1   1   incorrect
  2   2   missed
  3   2   incorrect
  4   3   missed
  5   3   missed
  6   2   correct
  7   4   pass
  
  </code></pre>
  
  <p>I'm trying to get the original dataframe to look like this. Where <code>only_missed</code> is <code>yes</code> if <code>missed</code> is the only type in the group.</p>
  
  <pre><code>    key type    only_missed
  0   1   correct     no
  1   1   incorrect   no
  2   2   missed      no
  3   2   incorrect   no
  4   3   missed      yes
  5   3   missed      yes
  6   2   correct     no
  7   4   pass        pass
  </code></pre>
  
  <p>I tried this but the output is unexpected:</p>
  
  <pre><code>a = ['correct', 'incorrect']
  m = ['missed']
  df['only_missed'] = df.groupby('key')['type'].transform(lambda x: 'no' if all(x.isin(a)) else ('yes' if all(x.isin(m)) else 'pass'))
  df
     key  type    only_missed
  0   1   correct     no
  1   1   incorrect   no
  2   2   missed      pass
  3   2   incorrect   pass
  4   3   missed      yes
  5   3   missed      yes
  6   2   correct     pass
  7   4   pass        pass
  </code></pre>
  
  <p>This one has really stumped me as I've gone through several iterations here to try and figure out what's going on.</p>
  
  <p>The help is greatly appreciated.</p>