Pandas groupby mean – into a dataframe?

All we need is an easy explanation of the problem, so here it is. Say my data looks like this: date,name,id,dept,sale1,sale2,sale3,total_sale 1/1/17,John,50,Sales,50.0,60.0,70.0,180.0 1/1/17,Mike,21,Engg,43.0,55.0,2.0,100.0 1/1/17,Jane,99,Tech,90.0,80.0,70.0,240.0 1/2/17,John,50,Sales,60.0,70.0,80.0,210.0 1/2/17,Mike,21,Engg,53.0,65.0,12.0,130.0 1/2/17,Jane,99,Tech,100.0,90.0,80.0,270.0 1/3/17,John,50,Sales,40.0,50.0,60.0,150.0 1/3/17,Mike,21,Engg,53.0,55.0,12.0,120.0 1/3/17,Jane,99,Tech,80.0,70.0,60.0,210.0…

Continue ReadingPandas groupby mean – into a dataframe?