title: how to select a row from a groupby object in pandas
body: <p>I have the following dataset <a href="https://i.stack.imgur.com/gAuCN.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>and I want to find the most popular genres from year to year.
  So I was planning to do that by first grouping the rows by year and genre,
  then selecting the most repeated genre for each year.</p>
  <p>I was able to group by year and genre then finding the counts using the following code
  <code>x = df.groupby(['release_year','genres']).count()['id']</code>
  where <code>id</code> is just an arbitrary column I used to find the counts for each genre</p>
  <p>And I get the following results</p>
  <pre><code>release_year  genres         
  1960          Action               5
                Adventure            5
                Comedy               7
                Crime                2
                Drama               10
                                  ... 
  2015          Science Fiction     54
                TV Movie             6
                Thriller           103
                War                  6
                Western              4
  Name: id, Length: 1000, dtype: int64
  </code></pre>
  <p>My problem is that I am unable to select the max for each year, can somebody help me do that?</p>