Last active
September 30, 2020 18:49
-
-
Save mogumogu2333/6eabe0b6352d06d9385180417d691bc7 to your computer and use it in GitHub Desktop.
[sort by dict value] Sort a python dict by value #python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
sorted_x = sorted(word_count.items(), key=operator.itemgetter(1), reverse=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment