A popular form of data analysis is split-apply-combine, in which you split your data into groups, apply some sort of processing on each group, and then combine the results.
Let's consider a data analysis where we want to obtain the two cars with the best miles per gallon (mpg) for each cylinder cou...