0

I have a list of sales reps and each rep has multiple sales listed for the year. I am trying to identify just the top sales rep and the bottom sales rep.

With the following line of code I am able to sum sales by rep, but I also need a print line that identifies who the top and bottom sales reps were.

Sample Data

Region -- Rep -- Total

East -- Tony -- 189.05

East -- Tony -- 999.50

Central -- Billy -- 179.64

Central -- Billy -- 539.73

West -- Sammy -- 167.44

East -- Suzy -- 299.40

Central -- Billy -- 149.25

Central -- Billy -- 449.10

West -- Sally -- 63.68

print(pd.pivot_table(df,index = ["Rep"], values = ["Total"],aggfunc=np.sum))

  • 1
    Your question needs a minimal reproducible example consisting of sample input, expected output, actual output, and only the relevant code necessary to reproduce the problem. See [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) for best practices related to Pandas questions. – itprorh66 Nov 22 '22 at 20:52

0 Answers0