My question is simple, I have a dataframe as follows:
Name Meal
0 John Chicken
1 John Chicken
2 John Pizza
3 Paul Chicken
4 Paul Pizza
5 Paul Pizza
6 Jack Chicken
7 Jack Chicken
8 Jack Fish
I want to somehow conditionally group by to create new series in a new dataframe that specify the count of each meal type, e.g.:
Name Chicken_meals Pizza_meals Fish_meals
0 John 2 1 0
1 Paul 1 2 0
2 Jack 2 0 1
This is my first question so apologies if the formatting isn't perfect - I tried my best! Thanks in advance!