title: Pandas: Group by, filter rows, get the mean
body: <p>In python I have a pandas data frame <code>df</code> like this:</p>
  
  <pre><code> ID      Geo    Speed
  123    False       40
  123     True       90
  123     True       80
  123    False       50
  123     True       10
  456    False       10
  456     True       90
  456    False       40
  456     True       80
  </code></pre>
  
  <p>I want to group <code>df</code> by <code>ID</code>, and filter out rows where <code>Geo == False</code>, and get the mean of <code>Speed</code> in the group. So the result should look like this.</p>
  
  <pre><code> ID     Mean 
  123       60  
  456       85  
  </code></pre>
  
  <p>My attempt: </p>
  
  <pre><code>df.groupby('ID')["Geo" == False].Speed.mean()
  df.groupby('ID').filter(lambda g: g.Geo == False)
  df[df.Geo.groupby(df.ID) == False]
  </code></pre>
  
  <p>Neither of them worked. 
  Any solutions? Thank you!</p>