title: Plot with pandas: group and mean
body: <p>My data from my 'combos' data frame looks like this:</p>
  
  <pre><code>pr = [1.0,2.0,3.0,4.0,1.0,2.0,3.0,4.0,1.0,2.0,3.0,4.0,.....1.0,2.0,3.0,4.0]
  
  lmi = [200, 200, 200, 250, 250,.....780, 780, 780, 800, 800, 800]
  
  pred = [0.16, 0.18, 0.25, 0.43, 0.54......., 0.20, 0.34, 0.45, 0.66]
  </code></pre>
  
  <p>I plot the results like this:</p>
  
  <pre><code>fig,ax = plt.subplots()
  
  for pr in [1.0,2.0,3.0,4.0]:
      ax.plot(combos[combos.pr==pr].lmi, combos[combos.pr==pr].pred, label=pr)
  
  ax.set_xlabel('lmi')
  ax.set_ylabel('pred')
  ax.legend(loc='best')
  </code></pre>
  
  <p>And I get this plot:</p>
  
  <p><a href="https://i.stack.imgur.com/qZKGM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qZKGM.png" alt="enter image description here"></a></p>
  
  <p>How can I plot means of "pred" for each "lmi" data point when keeping the pairs (lmi, pr) intact?</p>