Select the max row per group – pandas performance issue
The fastest option depends not only on length of the DataFrame (in this case, around 13M rows) but also on the number of groups. Below are perfplots which compare a number of ways of finding the maximum in each group: If there an only a few (large) groups, using_idxmax may be the fastest option: If … Read more