I am trying to do the aggregation on different column and different aggregation on same columns also i.e. in below example I am calculating sum on stake_amount and count on log win. However, I need to calculate mean on stake_amount and rename as average in this code.following one is working as long as I am doing one aggregation on stake_amount but as soon as I try to add another aggregation as mean it shows only mean, not sum please help... following is working as one aggregation.
table_name.groupby(['WIN_RETURN_SIZE']).
agg({'LOG_WIN':'count','STAKE_AMOUNT':'sum'})
.rename(columns={'LOG_WIN':'FREQUENCY','STAKE_AMOUNT':'QUANTITY'})
.reset_index()
when I need to do this (get sum and mean on same column with all other aggregation here)
FF_MEGAWAYS.groupby(['WIN_RETURN_SIZE']).
agg({'LOG_WIN':'count','STAKE_AMOUNT':'sum','STAKE_AMOUNT':'mean'}).
rename(columns={'LOG_WIN':'FREQUENCY','STAKE_AMOUNT':'QUANTITY'})
.reset_index()
Any help will be appricated