A sales database logs individual transactions with a product name and revenue amount. Aggregate the data to return total revenue per product, sorted alphabetically by product name.
df
| column | type |
|---|---|
| product | str |
| revenue | float |
| product | revenue |
|---|---|
| Widget | 100.0 |
| Gadget | 200.0 |
| Widget | 150.0 |
| Gadget | 50.0 |
| Doohickey | 300.0 |
| product | total_revenue |
|---|---|
| Doohickey | 300.0 |
| Gadget | 250.0 |
| Widget | 250.0 |
Revenue is summed per product (Gadget: 200 + 50 = 250, Widget: 100 + 150 = 250), then the result is sorted alphabetically so Doohickey comes first.
df shape = (4, 2), columns: product, revenue