If I have a dataframe like this:
Area | Favorite Fruit |
---|---|
UT | Banana |
TN | Grape |
VT | Banana |
AZ | Banana |
CA | Cherry |
I want to insert a column with a count for how many times the fruit appears across the df like so:
Area | Favorite Fruit | Fruit Count |
---|---|---|
UT | Banana | 3 |
TN | Grape | 1 |
VT | Banana | 3 |
AZ | Banana | 3 |
CA | Cherry | 1 |
Trying to do this in python.