I am trying to go through some data to find which category of products had the highest revenue.
I can get the actual total revenue of the category with the highest revenue by running:
max_revenue_by_cat = summer_transactions.groupby('item_category_id')['total_sales'].sum().max()
But how do I then get what category_id that max revenue belonged to? i.e. the category_id with the highest number of total_sales