counts = Counter(data)
words = sorted(counts, key=lambda word: (-counts[word], word))
print(words)
How to organize list by frequency of occurrence and alphabetically (in case of a tie) while eliminating duplicates?