我有一个这样分组的数据框;
price quantity vat
date brand
20-Jun-13 Reebok 7.0 8 2.2
Adidas 12.0 3 3.8
Campus 2.5 38 4.2
Woodlands 23.0 9 7.2
Boot 3.2 35 3.3
21-Jun-13 Reebok 7.0 6 2.2
Adidas 12.0 23 3.8
Campus 2.5 18 4.2
Woodlands 23.0 29 7.2
Boot 3.2 15 3.3
22-Jun-13 Reebok 5.0 2 3.5
Adidas 10.0 5 2.8
Campus 2.0 50 3.5
Woodlands 25.0 4 6.5
Boot 2.5 10 2.8
我如何分组'date'
和'brand'
乘以'price'
和'quantity'
计算销售额?
我试过了;
打印data2.groupby(['date','brand'])['price'] * ['quantity']
我想按日期计算总销售额。