using pandas to analyze sales data code example Example: get the most sales product in dataframe df.groupby(["Rep"]).sum().sort_values("Units", ascending=False)