I have a pandas dataframe with dates as index and several criterions (customer group, quantity, ...). Dates can occur multiple times as there can be different sells every day. An example could be:
date --- quantity --- group
2018-03-22 --- 1 --- 100
2018-03-24 --- 10 --- 102
2018-03-25 --- 5 --- 102
2018-03-25 --- 2 --- 100
2018-03-25 --- 3 --- 102
What would be an elegant solution to sum up all elements with a specific date (index) that are in one group. So I'd like to have a dataframe that has only the unique dates as indices and columns that are the group numbers and the elements are the sum over the different quantities, so e.g. for 2018-03-25 it is 8 for group 102 and 2 for group 100.
Any help is appreciated. Thanks, Franz.