I have an array of strings. I want to get the most frequent 20 items from the list.
Asked
Active
Viewed 151 times
0
-
1Please could you provide sample input and output (as well as any code you've tried) ? – Adi219 Aug 09 '18 at 09:15
-
Is it a list of strings or an array? An [`mcve`](https://stackoverflow.com/help/mcve) would be better. – Divakar Aug 09 '18 at 09:20
-
Also take a look at the [Counter](https://docs.python.org/3/library/collections.html#collections.Counter) docs, especially the `.most_common` method. – PM 2Ring Aug 09 '18 at 09:24