title: how to iterate through this and sort
body: <p>I'm taking a mongo course that's using python language. I have to remove/delete each student's lowest homework grade. With this query, I pulled up the homework grades, and sorted them by student and grade</p>
  
  <pre><code>db.grades.find( { 'type' : 'homework' }, { 'student_id' : 1, 'score' : 1, '_id' : 0}).sort({ 'student_id' : 1, 'score' : 1 })
  </code></pre>
  
  <p>I arranged the query so that only the student id and score are displayed, like this. These are only the first 10 students. There are actually 400. Now I have to sort through them and delete the lowest grade for each.</p>
  
  <p>Question is, how do I sort through this to remove the lowest grade for each student?  </p>
  
  <pre><code>{ "student_id" : 0, "score" : 14.8504576811645 }
  { "student_id" : 0, "score" : 63.98402553675503 }
  { "student_id" : 1, "score" : 21.33260810416115 }
  { "student_id" : 1, "score" : 44.31667452616328 }
  { "student_id" : 2, "score" : 60.9750047106029 }
  { "student_id" : 2, "score" : 97.75889721343528 }
  { "student_id" : 3, "score" : 50.81577033538815 }
  { "student_id" : 3, "score" : 92.71871597581605 }
  { "student_id" : 4, "score" : 5.244452510818443 }
  { "student_id" : 4, "score" : 28.656451042441 }
  { "student_id" : 5, "score" : 23.29430953857654 }
  { "student_id" : 5, "score" : 41.21853026961924 }
  { "student_id" : 6, "score" : 81.23822046161325 }
  { "student_id" : 6, "score" : 89.72700715074382 }
  { "student_id" : 7, "score" : 63.35102050393443 }
  { "student_id" : 7, "score" : 85.56691619291915 }
  { "student_id" : 8, "score" : 66.42784200049636 }
  { "student_id" : 8, "score" : 67.29005808579812 }
  { "student_id" : 9, "score" : 16.60130789148128 }
  { "student_id" : 9, "score" : 75.29561445722392 }
  </code></pre>