I have a dataset that contains the columns
| Year | Movie | ratings |
|---|---|---|
| 2022 | abc | 9 |
| 2022 | xyz | 8 |
| 2021 | nyz | 9.5 |
| 2021 | uxe | 7 |
Now there are over 10k+ data like this, How can I find Highest rated movie by each year?
I am trying this
df.groupby(by='genre')['imdb_rating'].max()
But this won't give me movie name, it will give rating by each year, how do I find Highest rated movie by each year?