Question: With python 3: 1). Append a new variable ( Amount= UnitPrice* Units) 2). Average unit price for each region. Use the groupby()method 3). Average unit
With python 3:
1). Append a new variable ( Amount= UnitPrice* Units)
2). Average unit price for each region. Use the groupby()method
3). Average unit price for each region. Use the pivot_table()method.
| Date | Region | Item | UnitPrice | Units |
| 14-Jul-18 | East | Pen Set | 3.85 | 71 |
| 16-Jul-18 | East | Binder | 14.00 | 31 |
| 22-Jul-18 | Central | Pen Set | 10.50 | 46 |
| 25-Jul-18 | West | Binder | 22.00 | 44 |
Step by Step Solution
3.48 Rating (161 Votes )
There are 3 Steps involved in it
1 Append a new variable Amount UnitPrice Units The following code can be used to append a new variab... View full answer
Get step-by-step solutions from verified subject matter experts
