One of the most basic and common operations to perform during a data analysis is to select rows containing the largest value of some column within a group. For instance, this would be like finding the highest rated film of each year or the highest grossing film by content rating. To accomplish this task, we need to sort the groups as well as the column used to rank each member of the group, and then extract the highest member of each group.
Selecting the largest of each group by sorting
Getting ready
In this recipe, we will find the highest rated film of each year.