Count values with Counter
Count repeated values and show the most common with Counter.
Original Pearto instructional example. Test it in your own environment and adapt it to your requirements.
from collections import Counter values = ['Python','Go','Python','Rust','Go','Python'] print(Counter(values).most_common(2))