This is my csv look like,
name, cuisine, review
A, Chinese, this
A, Indian, is
B, Indian, an
B, Indian, example
B, French, thank
C, French, you
I trying to count how many times the diff kind of cuisines appear by name. This is what I should be getting
Cuisine, Count
Chinese, 1
Indian, 2
French, 2
But as you can see there are duplicates within the name e.g. B so I try to drop_duplicates but I can't. I use
df.groupby('name')['cuisine'].drop_duplicates()
and it says series groupby object cannot.
Somehow I need to apply value_counts() to get the number of occurrences of the cuisine word but the duplicates thing is hindering. Any idea how I can get this in pandas? Thanks.