title: Python - How to extract subset under first row condition
body: <p>I'm looking for a way in order to take subset with a condition on the first row obtain by a <code>groupby</code>, let's see an example to be more clear:</p>
  
  <pre><code>    ID         Date             Diff     Class
   0  010101     11/12/2008       NaN      Good
   1  010102     02/07/2008       NaN      Very Good
   2  010102     08/07/2008       6.0      Bad
   3  010103     12/02/2009       NaN      Very Bad
   4  010104     07/05/2007       NaN      Very Good
  </code></pre>
  
  <p>So I'm looking for a way to obtain the following subset, due to the first class per ID, here, <code>Very Good</code> for the first time it appears:</p>
  
  <pre><code>   ID         Date             Diff     Class
     010102     02/07/2008       NaN      Very Good
     010102     08/07/2008       6.0      Bad
     010104     07/05/2007       NaN      Very Good
  </code></pre>
  
  <p>Thanks for your help,</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(
      [
          {"ID": 010101, "Date": '11/12/2008', "Class" : "Good"},
          {"ID": 010102, "Date": '02/07/2008', "Class" : "Very Good"},
          {"ID": 010102, "Date": '08/07/2008', "Diff": 6.0 , "Class" : "Bad"},
          {"ID": 010103, "Date": '12/02/2009', "Class" : "Very Bad"},
          {"ID": 010104, "Date": '07/05/2007', "Class" : "Very Good"},
      ],
      columns=["ID", "Date", "Diff", "Class"],
  )
  </code></pre>