I am trying to count how many orders there was for each product, by using the line of code below
TSP_Order = TSP_Order.groupby(['ProdName','Year']).count('OrderID')
But i receive the error below
TypeError: count() takes 1 positional argument but 2 were given
An example of my dataset
| ProdName | OrderID | Year |
|---|---|---|
| Toy Car | 1 | 2015 |
| Puzzle | 1 | 2015 |
| Toy Car | 2 | 2015 |
| Train Set | 2 | 2015 |
| Toy Car | 3 | 2016 |
| Puzzle | 4 | 2016 |
| Toy Car | 5 | 2016 |
| Train Set | 5 | 2016 |
I want to calculate how many times each product was ordered per year.