I have a dataframe that shows order listing. How do I use it to find the number of orders that contain spicy food?
Order Item Name Spicy
0 1000 Calamari Rings No
1 1001 Cheesecake No
2 1001 Spicy Chicken Yes
3 1002 Spicy Lamb Yes
Using this code gives me 2 Yes and 2 No, but it should actually be 2 Yes and 1 No as order 1001 is duplicated. Thank you.
dd = df_orders.groupby("Item Name")["Order"].count()
I would like to get an output that shows the number of orders that contains spicy food.
Spicy
0 Yes 2
1 No 1