Most common words

To find the most common words, we can apply the DSU pattern; most_common takes a histogram and returns a list of word-frequency tuples, sorted in reverse order by frequency:

                       

Here is a loop that prints the ten most common words:

 

 

from Thinking in Python

posted @ 2014-08-17 16:16  平静缓和用胸音说爱  阅读(210)  评论(0编辑  收藏  举报