I have a list that contains multiple words. It looks like this:
Food = ['apple', 'orange', 'banana', 'orange', 'strawberry', 'apple', 'orange', banana', apple']
Is there any way that I could rank the number of times each fruit is used? The code also has to allow for multiple places to make is look like this:
(apple, 1), (orange, 1), (banana, 3), (strawberry, 4).
I tried to use the ranking function but had no idea what to do after I downloaded from github and unzipped it.
I am not looking for a count of how many times each word is used but more like a ranking kind of thing. Something like 1st, 2nd, 3rd. But let's say that if two of the items have 3 occurrences while the rest have less it will look like: 1, 1, 3, 4, 5 etc.