title: Counting column values based on values in other columns in Pandas
body: <p>I am trying to count how many 0 and 1 a student got with pandas in python. For example, I have the following data frame.</p>
  <pre><code>+----------------------------------+--------+
  |             Students             | Grades |  
  +----------------------------------+--------+
  | Student1                         |      0 |
  | Student1                         |      1 |
  | Student1                         |      2 |
  | Student2                         |      3 |
  | Student2                         |      5 |
  | Student2                         |      0 |
  | Student3                         |      3 |
  | Student3                         |      4 |
  | Student3                         |      5 |
  +----------------------------------+--------+
  </code></pre>
  <p>As you can see student1 got one grade 0 and one grade 1 totally he got 2. Student2 got only 1 and student3 got 0 (no grade 1 and 0) . I could not figure out how to do it. does anyone know the code to count?</p>