I desire to achieve something we do in sql as follows:
SELECT Column1, Column2, mean(Column3), sum(Column4)
FROM SomeTable
GROUP BY Column1, Column2
Store_Code Brand_Code Sales_Price
1 18 28.00
2 17 105.33
2 17 65.33
1 17 30.67
1 18 6.67
As in above dataset I desire to group this dataframe with store code and taking most frequent brand code and sales price as it is or implementing some other operation like mean on sales price.
Currently all I am able to do is apply one single operation to all columns.
something like this
data.groupby(level=['Store_Code]).sum()
Store_Code Brand_Code Sales_Price
1 18 17.33
17 30.67
2 17 85.33