O'Reilly logo
  • Bob McDonald thinks this is interesting:

Returning to the tipping dataset from before, suppose you wanted to select the top five tip_pct values by group. First, write a function that selects the rows with the largest values in a particular column:


Cover of Python for Data Analysis, 2nd Edition


Currently selects smallest values