In [58]:
import requests
In [59]:
r = requests.get('http://eff.org')
In [60]:
type(r)
Out[60]:
requests.models.Response
In [61]:
s = r.text
In [62]:
type(s)
Out[62]:
str
In [63]:
s[:500]
Out[63]:
'<!DOCTYPE html>\n  <!--[if IEMobile 7]><html class="no-js ie iem7" lang="en" dir="ltr"><![endif]-->\n  <!--[if lte IE 6]><html class="no-js ie lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr"><![endif]-->\n  <!--[if (IE 7)&(!IEMobile)]><html class="no-js ie lt-ie9 lt-ie8" lang="en" dir="ltr"><![endif]-->\n  <!--[if IE 8]><html class="no-js ie lt-ie9" lang="en" dir="ltr"><![endif]-->\n  <!--[if (gte IE 9)|(gt IEMobile 7)]><html class="no-js ie" lang="en" dir="ltr" prefix="fb: http://ogp.me/ns/fb# og: http://'
In [64]:
r = requests.get('http://blue.math.buffalo.edu')

Spoofing your user agent string

In [65]:
fakeua = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"
In [66]:
myheaders = {'User-Agent':fakeua}
In [67]:
r = requests.get('http://blue.math.buffalo.edu',headers=myheaders)

Let's get a large text

In [68]:
f = open('hamlet.txt')
s = f.read()  # entire file into a single string
f.close()
In [69]:
# or to get the file closed automatically:
with open('hamlet.txt') as f:
    s = f.read()
In [70]:
len(s)
Out[70]:
197305
In [71]:
'To be, or not to be' in s
Out[71]:
True
In [72]:
nwords = len(s.split())  # by default splits on any whitespace 
nwords
Out[72]:
35064

"Word-count": for each distinct word in text, how many times does it appear?

Let's clean a little first

In [73]:
s = s.lower()  # convert any uppercase to lower case
In [74]:
'To be, or not to be' in s
Out[74]:
False
In [75]:
'to be, or not to be' in s
Out[75]:
True

Get rid of any punctuation

In [76]:
punc = ',.:;?!()[]"\'@#_'
punc
Out[76]:
',.:;?!()[]"\'@#_'
In [77]:
for c in punc:
    print(c)
,
.
:
;
?
!
(
)
[
]
"
'
@
#
_
In [78]:
for c in punc:
    s = s.replace(c,'')
In [79]:
words = s.split()
In [80]:
len(words)
Out[80]:
35064

Word count

Make a dictionary with words as keys and counts as values

In [81]:
wc = {}  
for word in words:
    if word not in wc: wc[word] = 0
    wc[word] += 1        
In [82]:
'The lazy    dog ...'.split()
Out[82]:
['The', 'lazy', 'dog', '...']
In [83]:
d = {'a':4,'b':77}
In [84]:
d['blah'] = 999
d
Out[84]:
{'a': 4, 'b': 77, 'blah': 999}
In [85]:
wc
Out[85]:
{'unpeg': 1,
 'asking': 2,
 'aroused': 1,
 'imponed': 2,
 'unshaken': 1,
 'capital': 2,
 'scrimers': 1,
 'constant': 2,
 'reaching': 1,
 'wine': 1,
 'entreatments': 1,
 'keep': 20,
 'barren': 1,
 'approve': 2,
 'delay': 2,
 'deer': 1,
 'brings': 1,
 'bespeak': 1,
 'distemper': 3,
 'th’ambassadors': 2,
 'employ': 1,
 'information': 9,
 'them—that': 1,
 'ein': 1,
 'crew': 2,
 'grass': 2,
 'poisoner': 2,
 'cozen’d': 1,
 'sea': 6,
 'unmanly': 1,
 'tenders': 3,
 'poison’d': 4,
 'rosencrantz': 78,
 'i’d': 1,
 'quarter’d': 1,
 'aloof': 2,
 'waist': 1,
 'siege': 1,
 'entity': 3,
 'blench': 1,
 'amazement': 2,
 'lays': 1,
 'push—': 1,
 'wisdoms': 1,
 'wittenberg': 4,
 'cozenage—is’t': 1,
 'strokes': 1,
 'discord': 1,
 'bark': 1,
 'certainty': 1,
 'rugged': 2,
 'reechy': 1,
 'updated': 2,
 'knew’st': 1,
 'v': 6,
 'royalties': 2,
 'remorseless': 1,
 'part': 30,
 'contend': 1,
 'blame': 3,
 'horse': 3,
 'planets': 1,
 'bugs': 1,
 'caps': 1,
 'addition': 4,
 'suddenly': 1,
 'wilfully': 1,
 'summons': 1,
 'rhenish': 2,
 'consequence': 2,
 'demands': 2,
 'several': 2,
 'kin': 2,
 'rank': 7,
 'disposition': 5,
 'range': 1,
 'imitated': 1,
 'traitorous': 1,
 'allowed': 1,
 'cuckold': 1,
 'actions': 2,
 'determination': 1,
 'inaccurate': 1,
 'professor': 1,
 'silence': 5,
 'owl': 1,
 'pox': 1,
 'defeat': 2,
 'here’s': 8,
 'upon’t—': 1,
 'weaker': 1,
 'knew': 5,
 'blazon': 1,
 'cross': 1,
 'wring': 1,
 'found': 8,
 'alas': 11,
 'seas': 1,
 '‘friend’': 1,
 'alack': 3,
 's': 1,
 'stalk': 1,
 'door': 6,
 'drabbing': 1,
 'haply': 3,
 'o’erhanging': 1,
 'o’ermaster’t': 1,
 'beating': 3,
 'monsters': 1,
 'admirable': 1,
 'thank': 9,
 'reckon': 1,
 'worthy': 1,
 'imposed': 1,
 'why': 60,
 'forbid': 2,
 'bruit': 1,
 'going': 2,
 'known': 8,
 'aside': 11,
 'uses': 3,
 'accident': 3,
 'sick': 4,
 'gaged': 1,
 'revengeful': 1,
 'matin': 1,
 'mandate': 1,
 'employment': 2,
 'pleas’d': 1,
 'softly': 1,
 'legal': 2,
 'armour': 3,
 'jelly': 1,
 'arriv’d': 1,
 'tribute': 2,
 'scarcely': 2,
 'desire': 7,
 'gallows-maker': 1,
 'occur': 1,
 'hasten': 1,
 'forgotten': 1,
 'weeping': 1,
 'might’': 1,
 'depriv’d': 1,
 'damn’d': 5,
 'rat': 2,
 'amen': 1,
 'talk': 2,
 'mantle': 1,
 'revisit’st': 1,
 '1c': 2,
 'sir’': 1,
 'thence': 4,
 'murder': 12,
 'hems': 1,
 'play—i': 1,
 'uneffectual': 1,
 'appear': 4,
 'may': 86,
 'pronouncing': 1,
 'poisons': 1,
 'beseech': 7,
 'draws': 4,
 'meant': 4,
 'appetite': 1,
 'tempest': 1,
 'have': 187,
 'virtues': 2,
 'profoundest': 1,
 'sir': 72,
 'blanks': 1,
 'turneth': 1,
 'palmy': 1,
 'courtesy': 1,
 'through': 11,
 '’sblood': 2,
 'fortune': 11,
 'threaten': 1,
 'board': 1,
 'roof': 1,
 'ignorant': 2,
 'small': 3,
 'same': 13,
 'oh': 3,
 'with': 317,
 'ye': 4,
 'distill’d': 1,
 'ho': 13,
 'rate': 2,
 'deep': 4,
 'light': 9,
 'precurse': 1,
 'exclaim': 1,
 'hark': 1,
 'politician': 1,
 'manners—that': 1,
 'valiant': 2,
 'texts': 1,
 'primrose': 1,
 'incestuous': 3,
 'feet': 2,
 'encompassment': 1,
 'incorporal': 1,
 'conceal’d': 1,
 'highly—not': 1,
 'brother': 9,
 'reform’d': 1,
 'oath': 2,
 'pair': 2,
 'on’t—frailty': 1,
 'replacement': 5,
 'rags': 1,
 'allow’d': 1,
 'lightness': 1,
 'shuffling': 2,
 'beds': 1,
 'those': 22,
 'theme': 3,
 'fight': 3,
 'serves': 2,
 'whereto': 4,
 'intent': 2,
 'remembrances': 1,
 'dry': 3,
 'whereat': 1,
 'never': 26,
 'statists': 1,
 '1e1': 5,
 'favourite': 1,
 'god': 31,
 'jig-maker': 1,
 'all’s': 2,
 '’twould': 1,
 'profession': 1,
 'nettles': 1,
 'fares': 2,
 'envy': 2,
 'potion': 1,
 'woman': 7,
 'unimproved': 1,
 'goose-quills': 1,
 'many': 20,
 'film': 1,
 'leads': 1,
 'sage': 1,
 'was': 86,
 'happy': 3,
 'b': 2,
 'derive': 1,
 'darkest': 1,
 'blackest': 1,
 'bonnet': 1,
 'shocks': 1,
 'three-and-twenty': 1,
 'squeak': 1,
 'clout': 1,
 'bouts': 1,
 'loved': 3,
 'slender': 1,
 'concluded': 1,
 'fellow': 8,
 'jangled': 1,
 'permanent': 2,
 'machine': 2,
 'trifling': 1,
 'fates': 2,
 'passing': 3,
 'viewed': 1,
 'droppings': 1,
 'royalty': 3,
 'continent': 2,
 'wife': 9,
 'commune': 1,
 'distress': 1,
 'divide': 2,
 'pause': 4,
 'pole': 2,
 'endure': 1,
 'suffering': 1,
 'run': 2,
 'songs': 2,
 'computer': 2,
 'wittingly': 2,
 'grow': 8,
 'unweeded': 1,
 'accounted': 1,
 'assure': 1,
 'on': 138,
 'message': 1,
 'one—to': 1,
 'majesty': 16,
 'buzzers': 1,
 'puff’d': 2,
 'foundation': 22,
 'dream—ay': 1,
 'dipping': 1,
 'stew’d': 1,
 'strings': 1,
 'sinews': 2,
 'brain': 6,
 'quiddits': 1,
 'yon': 1,
 'shoon': 1,
 'maid’s': 1,
 'tumbled': 1,
 'particularly': 1,
 'wood': 1,
 'breaking': 2,
 'faculties': 2,
 'loses': 1,
 'survivor': 1,
 'babe': 1,
 'riotous': 1,
 'unyoke': 1,
 'nemean': 1,
 'disease': 1,
 'contrary': 1,
 'shortens': 1,
 'she': 46,
 'transformation': 1,
 'shent': 1,
 'woos': 1,
 'fall’n': 2,
 'bleed': 2,
 'confession': 3,
 'including': 8,
 'shalt': 5,
 'used': 4,
 'air': 12,
 'but’': 1,
 'plausive': 1,
 'creating': 4,
 'disclos’d': 2,
 'mourners': 1,
 'chalice': 1,
 'confusion': 1,
 'tune': 2,
 'earth': 20,
 'until': 1,
 'work': 55,
 'enlarg’d': 1,
 'profits': 1,
 'frock': 1,
 'gentleman': 18,
 'frown’d': 1,
 'devis’d': 1,
 'abatements': 1,
 'rich': 3,
 'queen—': 1,
 'make': 58,
 'revenue': 2,
 'thunders': 1,
 'thirty': 3,
 'sting': 2,
 'agent': 1,
 'voyage': 2,
 'beteem': 1,
 'pickaxe': 1,
 'vouchers': 2,
 'if': 135,
 'corporation': 1,
 'oblivion': 1,
 'safe': 2,
 'therefore': 15,
 'qualifies': 1,
 'call’t': 1,
 'barr’d': 1,
 'benefit': 1,
 'lowest': 1,
 'waste': 2,
 'lasting': 2,
 'gules': 1,
 'declines': 1,
 'musty': 1,
 'lover': 1,
 'feeling': 3,
 'metal': 1,
 'spent': 1,
 'sober': 1,
 'privy': 1,
 'neutral': 1,
 'o’erhasty': 1,
 'weedy': 1,
 'impasted': 1,
 'companions': 1,
 'o’erdoing': 1,
 'parley': 1,
 'please': 15,
 'heavy': 6,
 'woodcocks': 1,
 'churches': 1,
 'kill’d': 6,
 'fortunes': 2,
 'ill-breeding': 1,
 'daintier': 1,
 'bride-bed': 1,
 'shaking': 1,
 'cornelius': 7,
 '1': 1,
 'night’s': 1,
 'where': 60,
 'hent': 1,
 'cunnings—': 1,
 'attend': 1,
 'sunday': 1,
 '’fore': 1,
 'whensoever': 1,
 'presence': 3,
 'natural': 5,
 'rub': 2,
 'peevish': 1,
 'strongest': 1,
 'befall’n': 1,
 'whereof': 2,
 'apparition': 2,
 'assigns': 2,
 'peak': 1,
 'touching': 3,
 'gum': 1,
 'nor': 37,
 'donation': 1,
 'thou': 102,
 'third': 3,
 'rain': 1,
 'goes—mark': 1,
 'was’t': 3,
 'lay': 9,
 'suffers': 3,
 'prey': 1,
 'botch': 1,
 'seeing': 4,
 'fitting': 1,
 'show’d': 1,
 'also': 3,
 'offendendo': 1,
 'fardels': 1,
 'negligence': 2,
 'stone': 2,
 'printed': 2,
 'thing': 17,
 'ay': 37,
 'belike': 2,
 'achievements': 1,
 'murderous': 1,
 'count': 3,
 'smear’d': 1,
 'performed': 1,
 'hundreds': 1,
 'incapable': 1,
 'pagan': 1,
 'gregory': 1,
 'divulging': 1,
 'both': 30,
 'keeps': 5,
 'turk': 1,
 'giving': 3,
 'lender': 1,
 'accordance': 2,
 'perhaps': 5,
 'consequential': 1,
 'th’election': 2,
 'season': 6,
 'distributor': 1,
 'gaudy': 1,
 'mutes': 2,
 'eldest': 1,
 'knave': 5,
 'feed': 6,
 'lock': 2,
 'undertake': 2,
 'unwilling': 1,
 'jaw': 1,
 'treacherous': 2,
 'niggard': 1,
 'caesar': 2,
 'whor’d': 1,
 'mailing': 1,
 'bonds': 1,
 'impious': 1,
 'below': 6,
 'having': 2,
 'held': 2,
 'horseback': 1,
 'yeasty': 1,
 'dexterity': 1,
 'inmost': 1,
 'yours': 6,
 'scopes': 1,
 'grinning': 1,
 'poem': 1,
 'violence': 4,
 'claim': 2,
 'give': 63,
 'tempt': 3,
 'greatness': 1,
 'slanders': 1,
 'opposing': 1,
 'rule': 1,
 'our': 123,
 'pastoral-comical': 1,
 'lake': 1,
 'rise': 2,
 'holder': 4,
 'infect': 1,
 'bestow': 4,
 'come': 106,
 'german': 1,
 'nero': 1,
 'strangely': 2,
 'breeding': 1,
 'exit': 38,
 'mourn’d': 1,
 'fat': 6,
 'wars': 2,
 'met': 2,
 'stored': 1,
 'thrift': 4,
 'avouch': 1,
 'exits': 1,
 'bent': 2,
 'sable': 2,
 'shine': 1,
 'little': 18,
 'rome': 1,
 'service—two': 1,
 'precedent': 2,
 'currents': 2,
 'wonderful': 2,
 'stars': 4,
 'trail': 2,
 'internal': 1,
 'finger’d': 1,
 'th’ambassador': 1,
 'flood': 1,
 'neighbour’d': 1,
 'kissing': 1,
 'players': 20,
 'sooner': 2,
 'cataplasm': 1,
 'boarded': 1,
 'repose': 1,
 'beautied': 1,
 'accuse': 1,
 'bodkin': 1,
 'method': 3,
 'william': 4,
 'bray': 1,
 'actual': 1,
 'retires': 1,
 'trifle': 1,
 '3': 3,
 'galled': 1,
 'trappings': 1,
 'doctor': 1,
 'passes': 1,
 'spend': 1,
 'crimeful': 1,
 'breadth': 1,
 'dark': 1,
 'target': 1,
 'fare': 6,
 'calves': 1,
 'nine': 3,
 'live': 15,
 'knaves': 1,
 'belov’d': 1,
 'elect': 1,
 'carrying': 1,
 'th’alarm': 1,
 'clemency': 1,
 'unseen': 3,
 'importunity': 1,
 'promis’d': 2,
 'seal’d': 6,
 'ends': 2,
 '‘this': 1,
 'tedious': 2,
 'jealousy': 2,
 'hits': 3,
 'opposites': 1,
 'especial': 1,
 'tann’d': 1,
 'waits': 1,
 'o’ersways': 1,
 'thousand': 11,
 'unreclaimed': 1,
 'sweat': 2,
 'amber': 1,
 'that': 402,
 'prick’d': 1,
 'caviare': 1,
 'o’erthrown': 1,
 '1f1': 1,
 'do’t': 9,
 'dare': 6,
 'sending': 3,
 'compulsatory': 1,
 '’gins': 1,
 'performance': 1,
 'besides': 1,
 'gone': 14,
 'drinking': 1,
 'http//wwwgutenbergorg/1/5/2/1524/': 1,
 'memory': 10,
 'me—this': 1,
 'lain': 1,
 'traduc’d': 1,
 'rage': 3,
 'renamed': 1,
 'middle': 2,
 'awake': 2,
 'omen': 1,
 'weed': 1,
 'sister': 6,
 'load': 1,
 'funeral': 3,
 'warning': 1,
 'lest': 4,
 'breathe': 4,
 'ear': 17,
 'co-mingled': 1,
 'conveyance': 1,
 'electronic': 27,
 'ophelia’s': 1,
 'new-born': 1,
 'vision': 1,
 'law': 14,
 'portentous': 1,
 'scenes': 1,
 'recks': 1,
 'anchor’s': 1,
 'yesterday': 1,
 'alaska': 1,
 'whine': 1,
 'benetted': 1,
 'neither': 10,
 'scorns': 1,
 'positively': 1,
 'imagination': 4,
 'pelican': 1,
 'outface': 1,
 'array': 1,
 'appointment': 1,
 'sport': 3,
 'converted': 1,
 'battalions': 1,
 'glow-worm': 1,
 'robin': 1,
 'puzzles': 1,
 'longer—married': 1,
 'ominous': 1,
 'disk': 1,
 'digg’d': 1,
 'prolongs': 1,
 'affairs': 1,
 'sponge': 2,
 'produce': 1,
 'wishes': 1,
 'withdraw': 3,
 'doubts': 1,
 'apprehension': 2,
 'shoulder': 3,
 'idle': 3,
 'owns': 2,
 'seiz’d': 1,
 'o’ergrowth': 1,
 'hideous': 2,
 'abide': 1,
 'flattering': 1,
 'sound': 7,
 'alleys': 1,
 'royal': 3,
 'circumstance': 6,
 'december': 1,
 'element': 1,
 'dip': 1,
 'praise': 2,
 'camel': 2,
 'anoint': 1,
 'viewing': 1,
 'possessed': 1,
 'hate': 1,
 'unus’d': 1,
 'seeks': 2,
 'pebbles': 1,
 'stream': 1,
 'sphere': 1,
 'hypertext': 1,
 'excuse—ho': 1,
 'motion': 4,
 'comma': 1,
 'fix': 1,
 'lighted': 1,
 'equipment': 3,
 'uncle': 10,
 'point': 6,
 'braz’d': 1,
 'prophesy': 2,
 'created': 2,
 'out': 57,
 'thorny': 1,
 'least': 2,
 'additions': 1,
 'trademark/copyright': 1,
 'ubique': 1,
 'compare': 1,
 'heads': 2,
 'friends': 20,
 'wed': 3,
 'pull’d': 1,
 'knowledge': 1,
 'loggets': 1,
 'engag’d': 1,
 'pester': 1,
 'barefoot': 1,
 'muddy-mettled': 1,
 'chameleon’s': 1,
 'function': 1,
 'brought': 6,
 'dishes': 1,
 'promotion': 1,
 'edified': 1,
 'exercises': 1,
 '’one': 1,
 'scholar’s': 1,
 'perfections': 1,
 'ditchers': 1,
 'apply': 1,
 'rat’': 1,
 'cannons': 1,
 'breath': 9,
 'piece': 6,
 'draw': 9,
 'maimed': 1,
 'struck': 6,
 'word—': 1,
 'forc’d': 2,
 'retire': 1,
 'defend': 3,
 'interpret': 1,
 'desperate': 6,
 'ever': 13,
 '’tis': 73,
 'yield': 2,
 'directions': 1,
 'room': 28,
 'manner': 1,
 'remember’d': 1,
 'ambassadors': 3,
 'directly': 3,
 'credit': 1,
 'pales': 1,
 'remember': 11,
 'shark’d': 1,
 'advanc’d': 1,
 'house’s': 1,
 'secrecy': 3,
 'eastward': 1,
 'writing': 4,
 'faded': 1,
 'mortis’d': 1,
 '1998': 1,
 'ghost’s': 1,
 'expel': 1,
 'buys': 1,
 'concerning': 2,
 'bark’d': 1,
 'spacious': 1,
 'mortal': 5,
 'melodious': 1,
 'garb': 1,
 'hamlet’': 3,
 'moons': 1,
 'can': 44,
 'ossa': 1,
 'evidence': 1,
 'time—as': 1,
 'robustious': 1,
 'queen': 117,
 'done': 21,
 'coagulate': 1,
 'artless': 1,
 'thinking': 4,
 'proprietary': 1,
 'zone': 1,
 'weigh’d': 2,
 'unprofitable': 1,
 'thaw': 1,
 'firm': 1,
 'reliev’d': 2,
 'brands': 1,
 'devise': 1,
 'confound': 2,
 'fanned': 1,
 'arrest—o': 1,
 'wreck': 1,
 'allow': 2,
 'steep': 1,
 'stabs': 1,
 'helpful': 1,
 'forgot': 4,
 'loves': 7,
 'feature': 2,
 'favours': 2,
 '1f6': 1,
 'bloodily': 1,
 'hush': 1,
 '‘beautified’': 1,
 'fadoms': 1,
 'effect': 6,
 'origin': 2,
 'spark': 1,
 'breathes': 1,
 'fellies': 1,
 '’t': 2,
 'th’ulcer': 1,
 'thrall’d': 1,
 'there': 78,
 'tremble': 2,
 'pleased': 1,
 'freely': 8,
 'waves': 3,
 'joy': 8,
 'peal': 1,
 'valentine': 1,
 'speaks': 6,
 'withers': 1,
 'agree': 9,
 'enviously': 1,
 'turns': 1,
 'thoughts': 17,
 'questionable': 1,
 'stock': 1,
 'disclaimers': 1,
 'wit': 5,
 'clowns': 3,
 'behind': 9,
 'pledge': 1,
 'miching': 1,
 'speech': 16,
 'lacks': 1,
 'lethe': 1,
 'passage': 2,
 'windy': 1,
 'abominably': 1,
 'west': 2,
 'sentence': 2,
 'bout': 1,
 'up—': 1,
 'unpolluted': 1,
 'minds': 2,
 'named': 1,
 'needful': 2,
 'here': 53,
 'flushing': 1,
 'effort': 2,
 'crows': 1,
 'actors': 2,
 'o': 110,
 'lack': 6,
 'airy': 1,
 'piteous': 3,
 'whither': 1,
 'bound': 7,
 'diest': 1,
 'trophies': 1,
 'pearl': 1,
 'continual': 1,
 'entreaty': 2,
 'etext': 2,
 'man': 51,
 'spectators': 1,
 'enough': 7,
 'riband': 1,
 'proofread': 1,
 'colleagued': 1,
 'thought': 11,
 'almost': 12,
 'hold': 28,
 'praises': 1,
 'jade': 1,
 'unsifted': 1,
 'haunt': 1,
 'repent': 3,
 'rouse': 3,
 'slight': 1,
 'flush': 1,
 'odds': 3,
 'heartily': 3,
 'legally': 1,
 'play—': 1,
 'extolment': 1,
 'handsaw': 1,
 'mind': 12,
 'wrath': 1,
 'beggars': 1,
 'translate': 2,
 'growing': 1,
 'express’d': 1,
 'betimes': 1,
 'print': 1,
 'such-a-one’s': 1,
 'abstinence': 1,
 'exercise': 2,
 'sultry': 1,
 'mould': 1,
 'dismal': 2,
 'gertrude': 13,
 'indentures': 1,
 'holds': 5,
 'greetings': 1,
 'statutes': 1,
 'danger': 4,
 'advancing': 1,
 'sorrows': 1,
 'exactly': 1,
 'sentinels': 1,
 'sandal': 1,
 'hatch': 1,
 'glow': 1,
 'julius': 2,
 'aboard': 3,
 'conceited': 1,
 'lads': 1,
 'girdle': 1,
 'jointress': 1,
 'bearers': 2,
 'physical': 2,
 'quicksilver': 1,
 'grief': 14,
 'hatchment': 1,
 'donate': 3,
 'say': 53,
 'thereof': 1,
 'trumpet': 5,
 'maggots': 2,
 'scene': 44,
 'exists': 1,
 'observers': 1,
 'gib': 1,
 'singeing': 1,
 'pure': 3,
 'hall': 6,
 'ah': 3,
 'on’t': 8,
 'unkind': 1,
 'splenative': 1,
 'weakness': 2,
 'is': 362,
 'swear': 9,
 'thou’': 1,
 '*****': 2,
 'th’event—': 1,
 'commands': 1,
 'cutpurse': 1,
 'format': 4,
 'vulgar': 2,
 'powerfully': 1,
 'quietus': 1,
 '2': 1,
 'amities': 1,
 'travel': 2,
 'remaining': 1,
 'violent': 4,
 'impotence': 1,
 'knowing': 1,
 'hawk': 1,
 'cursed': 4,
 'takes': 11,
 'sicklied': 1,
 'ut': 1,
 'did': 66,
 'th’offence': 2,
 'render': 1,
 'grating': 1,
 'strutted': 1,
 'payments': 3,
 'lot': 2,
 'fits': 2,
 'occasions': 2,
 'owner': 6,
 'horrible': 4,
 'daughters': 1,
 'clear': 1,
 'lust': 2,
 'temperately': 1,
 'call’d': 1,
 'deal': 1,
 'pale': 8,
 'left': 3,
 'produced': 1,
 'study': 1,
 'that—prythee': 1,
 'midnight': 1,
 'liv’st': 1,
 'ladyship': 1,
 'begun': 4,
 'artery': 1,
 'compulsive': 1,
 'girl': 1,
 ...}
In [86]:
d
Out[86]:
{'a': 4, 'b': 77, 'blah': 999}
In [87]:
d.keys()
Out[87]:
dict_keys(['a', 'blah', 'b'])
In [88]:
d.values()
Out[88]:
dict_values([4, 999, 77])
In [89]:
d.items()
Out[89]:
dict_items([('a', 4), ('blah', 999), ('b', 77)])
In [90]:
for item in d.items():
    print(item)
('a', 4)
('blah', 999)
('b', 77)
In [91]:
wcl = list(wc.items())
In [92]:
wcl
Out[92]:
[('unpeg', 1),
 ('asking', 2),
 ('aroused', 1),
 ('imponed', 2),
 ('unshaken', 1),
 ('capital', 2),
 ('scrimers', 1),
 ('constant', 2),
 ('reaching', 1),
 ('wine', 1),
 ('entreatments', 1),
 ('keep', 20),
 ('barren', 1),
 ('approve', 2),
 ('delay', 2),
 ('deer', 1),
 ('brings', 1),
 ('bespeak', 1),
 ('distemper', 3),
 ('th’ambassadors', 2),
 ('employ', 1),
 ('information', 9),
 ('them—that', 1),
 ('ein', 1),
 ('crew', 2),
 ('grass', 2),
 ('poisoner', 2),
 ('cozen’d', 1),
 ('sea', 6),
 ('unmanly', 1),
 ('tenders', 3),
 ('poison’d', 4),
 ('rosencrantz', 78),
 ('i’d', 1),
 ('quarter’d', 1),
 ('aloof', 2),
 ('waist', 1),
 ('siege', 1),
 ('entity', 3),
 ('blench', 1),
 ('amazement', 2),
 ('lays', 1),
 ('push—', 1),
 ('wisdoms', 1),
 ('wittenberg', 4),
 ('cozenage—is’t', 1),
 ('strokes', 1),
 ('discord', 1),
 ('bark', 1),
 ('certainty', 1),
 ('rugged', 2),
 ('reechy', 1),
 ('updated', 2),
 ('knew’st', 1),
 ('v', 6),
 ('royalties', 2),
 ('remorseless', 1),
 ('part', 30),
 ('contend', 1),
 ('blame', 3),
 ('horse', 3),
 ('planets', 1),
 ('bugs', 1),
 ('caps', 1),
 ('addition', 4),
 ('suddenly', 1),
 ('wilfully', 1),
 ('summons', 1),
 ('rhenish', 2),
 ('consequence', 2),
 ('demands', 2),
 ('several', 2),
 ('kin', 2),
 ('rank', 7),
 ('disposition', 5),
 ('range', 1),
 ('imitated', 1),
 ('traitorous', 1),
 ('allowed', 1),
 ('cuckold', 1),
 ('actions', 2),
 ('determination', 1),
 ('inaccurate', 1),
 ('professor', 1),
 ('silence', 5),
 ('owl', 1),
 ('pox', 1),
 ('defeat', 2),
 ('here’s', 8),
 ('upon’t—', 1),
 ('weaker', 1),
 ('knew', 5),
 ('blazon', 1),
 ('cross', 1),
 ('wring', 1),
 ('found', 8),
 ('alas', 11),
 ('seas', 1),
 ('‘friend’', 1),
 ('alack', 3),
 ('s', 1),
 ('stalk', 1),
 ('door', 6),
 ('drabbing', 1),
 ('haply', 3),
 ('o’erhanging', 1),
 ('o’ermaster’t', 1),
 ('beating', 3),
 ('monsters', 1),
 ('admirable', 1),
 ('thank', 9),
 ('reckon', 1),
 ('worthy', 1),
 ('imposed', 1),
 ('why', 60),
 ('forbid', 2),
 ('bruit', 1),
 ('going', 2),
 ('known', 8),
 ('aside', 11),
 ('uses', 3),
 ('accident', 3),
 ('sick', 4),
 ('gaged', 1),
 ('revengeful', 1),
 ('matin', 1),
 ('mandate', 1),
 ('employment', 2),
 ('pleas’d', 1),
 ('softly', 1),
 ('legal', 2),
 ('armour', 3),
 ('jelly', 1),
 ('arriv’d', 1),
 ('tribute', 2),
 ('scarcely', 2),
 ('desire', 7),
 ('gallows-maker', 1),
 ('occur', 1),
 ('hasten', 1),
 ('forgotten', 1),
 ('weeping', 1),
 ('might’', 1),
 ('depriv’d', 1),
 ('damn’d', 5),
 ('rat', 2),
 ('amen', 1),
 ('talk', 2),
 ('mantle', 1),
 ('revisit’st', 1),
 ('1c', 2),
 ('sir’', 1),
 ('thence', 4),
 ('murder', 12),
 ('hems', 1),
 ('play—i', 1),
 ('uneffectual', 1),
 ('appear', 4),
 ('may', 86),
 ('pronouncing', 1),
 ('poisons', 1),
 ('beseech', 7),
 ('draws', 4),
 ('meant', 4),
 ('appetite', 1),
 ('tempest', 1),
 ('have', 187),
 ('virtues', 2),
 ('profoundest', 1),
 ('sir', 72),
 ('blanks', 1),
 ('turneth', 1),
 ('palmy', 1),
 ('courtesy', 1),
 ('through', 11),
 ('’sblood', 2),
 ('fortune', 11),
 ('threaten', 1),
 ('board', 1),
 ('roof', 1),
 ('ignorant', 2),
 ('small', 3),
 ('same', 13),
 ('oh', 3),
 ('with', 317),
 ('ye', 4),
 ('distill’d', 1),
 ('ho', 13),
 ('rate', 2),
 ('deep', 4),
 ('light', 9),
 ('precurse', 1),
 ('exclaim', 1),
 ('hark', 1),
 ('politician', 1),
 ('manners—that', 1),
 ('valiant', 2),
 ('texts', 1),
 ('primrose', 1),
 ('incestuous', 3),
 ('feet', 2),
 ('encompassment', 1),
 ('incorporal', 1),
 ('conceal’d', 1),
 ('highly—not', 1),
 ('brother', 9),
 ('reform’d', 1),
 ('oath', 2),
 ('pair', 2),
 ('on’t—frailty', 1),
 ('replacement', 5),
 ('rags', 1),
 ('allow’d', 1),
 ('lightness', 1),
 ('shuffling', 2),
 ('beds', 1),
 ('those', 22),
 ('theme', 3),
 ('fight', 3),
 ('serves', 2),
 ('whereto', 4),
 ('intent', 2),
 ('remembrances', 1),
 ('dry', 3),
 ('whereat', 1),
 ('never', 26),
 ('statists', 1),
 ('1e1', 5),
 ('favourite', 1),
 ('god', 31),
 ('jig-maker', 1),
 ('all’s', 2),
 ('’twould', 1),
 ('profession', 1),
 ('nettles', 1),
 ('fares', 2),
 ('envy', 2),
 ('potion', 1),
 ('woman', 7),
 ('unimproved', 1),
 ('goose-quills', 1),
 ('many', 20),
 ('film', 1),
 ('leads', 1),
 ('sage', 1),
 ('was', 86),
 ('happy', 3),
 ('b', 2),
 ('derive', 1),
 ('darkest', 1),
 ('blackest', 1),
 ('bonnet', 1),
 ('shocks', 1),
 ('three-and-twenty', 1),
 ('squeak', 1),
 ('clout', 1),
 ('bouts', 1),
 ('loved', 3),
 ('slender', 1),
 ('concluded', 1),
 ('fellow', 8),
 ('jangled', 1),
 ('permanent', 2),
 ('machine', 2),
 ('trifling', 1),
 ('fates', 2),
 ('passing', 3),
 ('viewed', 1),
 ('droppings', 1),
 ('royalty', 3),
 ('continent', 2),
 ('wife', 9),
 ('commune', 1),
 ('distress', 1),
 ('divide', 2),
 ('pause', 4),
 ('pole', 2),
 ('endure', 1),
 ('suffering', 1),
 ('run', 2),
 ('songs', 2),
 ('computer', 2),
 ('wittingly', 2),
 ('grow', 8),
 ('unweeded', 1),
 ('accounted', 1),
 ('assure', 1),
 ('on', 138),
 ('message', 1),
 ('one—to', 1),
 ('majesty', 16),
 ('buzzers', 1),
 ('puff’d', 2),
 ('foundation', 22),
 ('dream—ay', 1),
 ('dipping', 1),
 ('stew’d', 1),
 ('strings', 1),
 ('sinews', 2),
 ('brain', 6),
 ('quiddits', 1),
 ('yon', 1),
 ('shoon', 1),
 ('maid’s', 1),
 ('tumbled', 1),
 ('particularly', 1),
 ('wood', 1),
 ('breaking', 2),
 ('faculties', 2),
 ('loses', 1),
 ('survivor', 1),
 ('babe', 1),
 ('riotous', 1),
 ('unyoke', 1),
 ('nemean', 1),
 ('disease', 1),
 ('contrary', 1),
 ('shortens', 1),
 ('she', 46),
 ('transformation', 1),
 ('shent', 1),
 ('woos', 1),
 ('fall’n', 2),
 ('bleed', 2),
 ('confession', 3),
 ('including', 8),
 ('shalt', 5),
 ('used', 4),
 ('air', 12),
 ('but’', 1),
 ('plausive', 1),
 ('creating', 4),
 ('disclos’d', 2),
 ('mourners', 1),
 ('chalice', 1),
 ('confusion', 1),
 ('tune', 2),
 ('earth', 20),
 ('until', 1),
 ('work', 55),
 ('enlarg’d', 1),
 ('profits', 1),
 ('frock', 1),
 ('gentleman', 18),
 ('frown’d', 1),
 ('devis’d', 1),
 ('abatements', 1),
 ('rich', 3),
 ('queen—', 1),
 ('make', 58),
 ('revenue', 2),
 ('thunders', 1),
 ('thirty', 3),
 ('sting', 2),
 ('agent', 1),
 ('voyage', 2),
 ('beteem', 1),
 ('pickaxe', 1),
 ('vouchers', 2),
 ('if', 135),
 ('corporation', 1),
 ('oblivion', 1),
 ('safe', 2),
 ('therefore', 15),
 ('qualifies', 1),
 ('call’t', 1),
 ('barr’d', 1),
 ('benefit', 1),
 ('lowest', 1),
 ('waste', 2),
 ('lasting', 2),
 ('gules', 1),
 ('declines', 1),
 ('musty', 1),
 ('lover', 1),
 ('feeling', 3),
 ('metal', 1),
 ('spent', 1),
 ('sober', 1),
 ('privy', 1),
 ('neutral', 1),
 ('o’erhasty', 1),
 ('weedy', 1),
 ('impasted', 1),
 ('companions', 1),
 ('o’erdoing', 1),
 ('parley', 1),
 ('please', 15),
 ('heavy', 6),
 ('woodcocks', 1),
 ('churches', 1),
 ('kill’d', 6),
 ('fortunes', 2),
 ('ill-breeding', 1),
 ('daintier', 1),
 ('bride-bed', 1),
 ('shaking', 1),
 ('cornelius', 7),
 ('1', 1),
 ('night’s', 1),
 ('where', 60),
 ('hent', 1),
 ('cunnings—', 1),
 ('attend', 1),
 ('sunday', 1),
 ('’fore', 1),
 ('whensoever', 1),
 ('presence', 3),
 ('natural', 5),
 ('rub', 2),
 ('peevish', 1),
 ('strongest', 1),
 ('befall’n', 1),
 ('whereof', 2),
 ('apparition', 2),
 ('assigns', 2),
 ('peak', 1),
 ('touching', 3),
 ('gum', 1),
 ('nor', 37),
 ('donation', 1),
 ('thou', 102),
 ('third', 3),
 ('rain', 1),
 ('goes—mark', 1),
 ('was’t', 3),
 ('lay', 9),
 ('suffers', 3),
 ('prey', 1),
 ('botch', 1),
 ('seeing', 4),
 ('fitting', 1),
 ('show’d', 1),
 ('also', 3),
 ('offendendo', 1),
 ('fardels', 1),
 ('negligence', 2),
 ('stone', 2),
 ('printed', 2),
 ('thing', 17),
 ('ay', 37),
 ('belike', 2),
 ('achievements', 1),
 ('murderous', 1),
 ('count', 3),
 ('smear’d', 1),
 ('performed', 1),
 ('hundreds', 1),
 ('incapable', 1),
 ('pagan', 1),
 ('gregory', 1),
 ('divulging', 1),
 ('both', 30),
 ('keeps', 5),
 ('turk', 1),
 ('giving', 3),
 ('lender', 1),
 ('accordance', 2),
 ('perhaps', 5),
 ('consequential', 1),
 ('th’election', 2),
 ('season', 6),
 ('distributor', 1),
 ('gaudy', 1),
 ('mutes', 2),
 ('eldest', 1),
 ('knave', 5),
 ('feed', 6),
 ('lock', 2),
 ('undertake', 2),
 ('unwilling', 1),
 ('jaw', 1),
 ('treacherous', 2),
 ('niggard', 1),
 ('caesar', 2),
 ('whor’d', 1),
 ('mailing', 1),
 ('bonds', 1),
 ('impious', 1),
 ('below', 6),
 ('having', 2),
 ('held', 2),
 ('horseback', 1),
 ('yeasty', 1),
 ('dexterity', 1),
 ('inmost', 1),
 ('yours', 6),
 ('scopes', 1),
 ('grinning', 1),
 ('poem', 1),
 ('violence', 4),
 ('claim', 2),
 ('give', 63),
 ('tempt', 3),
 ('greatness', 1),
 ('slanders', 1),
 ('opposing', 1),
 ('rule', 1),
 ('our', 123),
 ('pastoral-comical', 1),
 ('lake', 1),
 ('rise', 2),
 ('holder', 4),
 ('infect', 1),
 ('bestow', 4),
 ('come', 106),
 ('german', 1),
 ('nero', 1),
 ('strangely', 2),
 ('breeding', 1),
 ('exit', 38),
 ('mourn’d', 1),
 ('fat', 6),
 ('wars', 2),
 ('met', 2),
 ('stored', 1),
 ('thrift', 4),
 ('avouch', 1),
 ('exits', 1),
 ('bent', 2),
 ('sable', 2),
 ('shine', 1),
 ('little', 18),
 ('rome', 1),
 ('service—two', 1),
 ('precedent', 2),
 ('currents', 2),
 ('wonderful', 2),
 ('stars', 4),
 ('trail', 2),
 ('internal', 1),
 ('finger’d', 1),
 ('th’ambassador', 1),
 ('flood', 1),
 ('neighbour’d', 1),
 ('kissing', 1),
 ('players', 20),
 ('sooner', 2),
 ('cataplasm', 1),
 ('boarded', 1),
 ('repose', 1),
 ('beautied', 1),
 ('accuse', 1),
 ('bodkin', 1),
 ('method', 3),
 ('william', 4),
 ('bray', 1),
 ('actual', 1),
 ('retires', 1),
 ('trifle', 1),
 ('3', 3),
 ('galled', 1),
 ('trappings', 1),
 ('doctor', 1),
 ('passes', 1),
 ('spend', 1),
 ('crimeful', 1),
 ('breadth', 1),
 ('dark', 1),
 ('target', 1),
 ('fare', 6),
 ('calves', 1),
 ('nine', 3),
 ('live', 15),
 ('knaves', 1),
 ('belov’d', 1),
 ('elect', 1),
 ('carrying', 1),
 ('th’alarm', 1),
 ('clemency', 1),
 ('unseen', 3),
 ('importunity', 1),
 ('promis’d', 2),
 ('seal’d', 6),
 ('ends', 2),
 ('‘this', 1),
 ('tedious', 2),
 ('jealousy', 2),
 ('hits', 3),
 ('opposites', 1),
 ('especial', 1),
 ('tann’d', 1),
 ('waits', 1),
 ('o’ersways', 1),
 ('thousand', 11),
 ('unreclaimed', 1),
 ('sweat', 2),
 ('amber', 1),
 ('that', 402),
 ('prick’d', 1),
 ('caviare', 1),
 ('o’erthrown', 1),
 ('1f1', 1),
 ('do’t', 9),
 ('dare', 6),
 ('sending', 3),
 ('compulsatory', 1),
 ('’gins', 1),
 ('performance', 1),
 ('besides', 1),
 ('gone', 14),
 ('drinking', 1),
 ('http//wwwgutenbergorg/1/5/2/1524/', 1),
 ('memory', 10),
 ('me—this', 1),
 ('lain', 1),
 ('traduc’d', 1),
 ('rage', 3),
 ('renamed', 1),
 ('middle', 2),
 ('awake', 2),
 ('omen', 1),
 ('weed', 1),
 ('sister', 6),
 ('load', 1),
 ('funeral', 3),
 ('warning', 1),
 ('lest', 4),
 ('breathe', 4),
 ('ear', 17),
 ('co-mingled', 1),
 ('conveyance', 1),
 ('electronic', 27),
 ('ophelia’s', 1),
 ('new-born', 1),
 ('vision', 1),
 ('law', 14),
 ('portentous', 1),
 ('scenes', 1),
 ('recks', 1),
 ('anchor’s', 1),
 ('yesterday', 1),
 ('alaska', 1),
 ('whine', 1),
 ('benetted', 1),
 ('neither', 10),
 ('scorns', 1),
 ('positively', 1),
 ('imagination', 4),
 ('pelican', 1),
 ('outface', 1),
 ('array', 1),
 ('appointment', 1),
 ('sport', 3),
 ('converted', 1),
 ('battalions', 1),
 ('glow-worm', 1),
 ('robin', 1),
 ('puzzles', 1),
 ('longer—married', 1),
 ('ominous', 1),
 ('disk', 1),
 ('digg’d', 1),
 ('prolongs', 1),
 ('affairs', 1),
 ('sponge', 2),
 ('produce', 1),
 ('wishes', 1),
 ('withdraw', 3),
 ('doubts', 1),
 ('apprehension', 2),
 ('shoulder', 3),
 ('idle', 3),
 ('owns', 2),
 ('seiz’d', 1),
 ('o’ergrowth', 1),
 ('hideous', 2),
 ('abide', 1),
 ('flattering', 1),
 ('sound', 7),
 ('alleys', 1),
 ('royal', 3),
 ('circumstance', 6),
 ('december', 1),
 ('element', 1),
 ('dip', 1),
 ('praise', 2),
 ('camel', 2),
 ('anoint', 1),
 ('viewing', 1),
 ('possessed', 1),
 ('hate', 1),
 ('unus’d', 1),
 ('seeks', 2),
 ('pebbles', 1),
 ('stream', 1),
 ('sphere', 1),
 ('hypertext', 1),
 ('excuse—ho', 1),
 ('motion', 4),
 ('comma', 1),
 ('fix', 1),
 ('lighted', 1),
 ('equipment', 3),
 ('uncle', 10),
 ('point', 6),
 ('braz’d', 1),
 ('prophesy', 2),
 ('created', 2),
 ('out', 57),
 ('thorny', 1),
 ('least', 2),
 ('additions', 1),
 ('trademark/copyright', 1),
 ('ubique', 1),
 ('compare', 1),
 ('heads', 2),
 ('friends', 20),
 ('wed', 3),
 ('pull’d', 1),
 ('knowledge', 1),
 ('loggets', 1),
 ('engag’d', 1),
 ('pester', 1),
 ('barefoot', 1),
 ('muddy-mettled', 1),
 ('chameleon’s', 1),
 ('function', 1),
 ('brought', 6),
 ('dishes', 1),
 ('promotion', 1),
 ('edified', 1),
 ('exercises', 1),
 ('’one', 1),
 ('scholar’s', 1),
 ('perfections', 1),
 ('ditchers', 1),
 ('apply', 1),
 ('rat’', 1),
 ('cannons', 1),
 ('breath', 9),
 ('piece', 6),
 ('draw', 9),
 ('maimed', 1),
 ('struck', 6),
 ('word—', 1),
 ('forc’d', 2),
 ('retire', 1),
 ('defend', 3),
 ('interpret', 1),
 ('desperate', 6),
 ('ever', 13),
 ('’tis', 73),
 ('yield', 2),
 ('directions', 1),
 ('room', 28),
 ('manner', 1),
 ('remember’d', 1),
 ('ambassadors', 3),
 ('directly', 3),
 ('credit', 1),
 ('pales', 1),
 ('remember', 11),
 ('shark’d', 1),
 ('advanc’d', 1),
 ('house’s', 1),
 ('secrecy', 3),
 ('eastward', 1),
 ('writing', 4),
 ('faded', 1),
 ('mortis’d', 1),
 ('1998', 1),
 ('ghost’s', 1),
 ('expel', 1),
 ('buys', 1),
 ('concerning', 2),
 ('bark’d', 1),
 ('spacious', 1),
 ('mortal', 5),
 ('melodious', 1),
 ('garb', 1),
 ('hamlet’', 3),
 ('moons', 1),
 ('can', 44),
 ('ossa', 1),
 ('evidence', 1),
 ('time—as', 1),
 ('robustious', 1),
 ('queen', 117),
 ('done', 21),
 ('coagulate', 1),
 ('artless', 1),
 ('thinking', 4),
 ('proprietary', 1),
 ('zone', 1),
 ('weigh’d', 2),
 ('unprofitable', 1),
 ('thaw', 1),
 ('firm', 1),
 ('reliev’d', 2),
 ('brands', 1),
 ('devise', 1),
 ('confound', 2),
 ('fanned', 1),
 ('arrest—o', 1),
 ('wreck', 1),
 ('allow', 2),
 ('steep', 1),
 ('stabs', 1),
 ('helpful', 1),
 ('forgot', 4),
 ('loves', 7),
 ('feature', 2),
 ('favours', 2),
 ('1f6', 1),
 ('bloodily', 1),
 ('hush', 1),
 ('‘beautified’', 1),
 ('fadoms', 1),
 ('effect', 6),
 ('origin', 2),
 ('spark', 1),
 ('breathes', 1),
 ('fellies', 1),
 ('’t', 2),
 ('th’ulcer', 1),
 ('thrall’d', 1),
 ('there', 78),
 ('tremble', 2),
 ('pleased', 1),
 ('freely', 8),
 ('waves', 3),
 ('joy', 8),
 ('peal', 1),
 ('valentine', 1),
 ('speaks', 6),
 ('withers', 1),
 ('agree', 9),
 ('enviously', 1),
 ('turns', 1),
 ('thoughts', 17),
 ('questionable', 1),
 ('stock', 1),
 ('disclaimers', 1),
 ('wit', 5),
 ('clowns', 3),
 ('behind', 9),
 ('pledge', 1),
 ('miching', 1),
 ('speech', 16),
 ('lacks', 1),
 ('lethe', 1),
 ('passage', 2),
 ('windy', 1),
 ('abominably', 1),
 ('west', 2),
 ('sentence', 2),
 ('bout', 1),
 ('up—', 1),
 ('unpolluted', 1),
 ('minds', 2),
 ('named', 1),
 ('needful', 2),
 ('here', 53),
 ('flushing', 1),
 ('effort', 2),
 ('crows', 1),
 ('actors', 2),
 ('o', 110),
 ('lack', 6),
 ('airy', 1),
 ('piteous', 3),
 ('whither', 1),
 ('bound', 7),
 ('diest', 1),
 ('trophies', 1),
 ('pearl', 1),
 ('continual', 1),
 ('entreaty', 2),
 ('etext', 2),
 ('man', 51),
 ('spectators', 1),
 ('enough', 7),
 ('riband', 1),
 ('proofread', 1),
 ('colleagued', 1),
 ('thought', 11),
 ('almost', 12),
 ('hold', 28),
 ('praises', 1),
 ('jade', 1),
 ('unsifted', 1),
 ('haunt', 1),
 ('repent', 3),
 ('rouse', 3),
 ('slight', 1),
 ('flush', 1),
 ('odds', 3),
 ('heartily', 3),
 ('legally', 1),
 ('play—', 1),
 ('extolment', 1),
 ('handsaw', 1),
 ('mind', 12),
 ('wrath', 1),
 ('beggars', 1),
 ('translate', 2),
 ('growing', 1),
 ('express’d', 1),
 ('betimes', 1),
 ('print', 1),
 ('such-a-one’s', 1),
 ('abstinence', 1),
 ('exercise', 2),
 ('sultry', 1),
 ('mould', 1),
 ('dismal', 2),
 ('gertrude', 13),
 ('indentures', 1),
 ('holds', 5),
 ('greetings', 1),
 ('statutes', 1),
 ('danger', 4),
 ('advancing', 1),
 ('sorrows', 1),
 ('exactly', 1),
 ('sentinels', 1),
 ('sandal', 1),
 ('hatch', 1),
 ('glow', 1),
 ('julius', 2),
 ('aboard', 3),
 ('conceited', 1),
 ('lads', 1),
 ('girdle', 1),
 ('jointress', 1),
 ('bearers', 2),
 ('physical', 2),
 ('quicksilver', 1),
 ('grief', 14),
 ('hatchment', 1),
 ('donate', 3),
 ('say', 53),
 ('thereof', 1),
 ('trumpet', 5),
 ('maggots', 2),
 ('scene', 44),
 ('exists', 1),
 ('observers', 1),
 ('gib', 1),
 ('singeing', 1),
 ('pure', 3),
 ('hall', 6),
 ('ah', 3),
 ('on’t', 8),
 ('unkind', 1),
 ('splenative', 1),
 ('weakness', 2),
 ('is', 362),
 ('swear', 9),
 ('thou’', 1),
 ('*****', 2),
 ('th’event—', 1),
 ('commands', 1),
 ('cutpurse', 1),
 ('format', 4),
 ('vulgar', 2),
 ('powerfully', 1),
 ('quietus', 1),
 ('2', 1),
 ('amities', 1),
 ('travel', 2),
 ('remaining', 1),
 ('violent', 4),
 ('impotence', 1),
 ('knowing', 1),
 ('hawk', 1),
 ('cursed', 4),
 ('takes', 11),
 ('sicklied', 1),
 ('ut', 1),
 ('did', 66),
 ('th’offence', 2),
 ('render', 1),
 ('grating', 1),
 ('strutted', 1),
 ('payments', 3),
 ('lot', 2),
 ('fits', 2),
 ('occasions', 2),
 ('owner', 6),
 ('horrible', 4),
 ('daughters', 1),
 ('clear', 1),
 ('lust', 2),
 ('temperately', 1),
 ('call’d', 1),
 ('deal', 1),
 ('pale', 8),
 ('left', 3),
 ('produced', 1),
 ('study', 1),
 ('that—prythee', 1),
 ('midnight', 1),
 ('liv’st', 1),
 ('ladyship', 1),
 ('begun', 4),
 ('artery', 1),
 ('compulsive', 1),
 ('girl', 1),
 ...]
In [93]:
mylist = [3,4,4,2,1]
sorted(mylist)
Out[93]:
[1, 2, 3, 4, 4]
In [94]:
mylist = ['banana','apple','orange']
sorted(mylist)
Out[94]:
['apple', 'banana', 'orange']
In [95]:
mylist = [(5,3),(5,4),(2,99)]
sorted(mylist)
Out[95]:
[(2, 99), (5, 3), (5, 4)]
In [97]:
sorted(wcl)
Out[97]:
[('$1', 1),
 ('$5000', 1),
 ('&c', 6),
 ('*', 4),
 ('***', 3),
 ('*****', 2),
 ('-', 3),
 ('1', 1),
 ('1500', 1),
 ('1524', 1),
 ('1524-0txt', 1),
 ('1524-0zip', 1),
 ('1998', 1),
 ('1a', 1),
 ('1b', 1),
 ('1c', 2),
 ('1d', 1),
 ('1e', 2),
 ('1e1', 5),
 ('1e2', 1),
 ('1e3', 1),
 ('1e4', 1),
 ('1e5', 1),
 ('1e6', 1),
 ('1e7', 3),
 ('1e8', 4),
 ('1e9', 3),
 ('1f', 1),
 ('1f1', 1),
 ('1f2', 1),
 ('1f3', 5),
 ('1f4', 1),
 ('1f5', 1),
 ('1f6', 1),
 ('2', 1),
 ('20%', 1),
 ('2001', 1),
 ('2017', 1),
 ('3', 3),
 ('30', 2),
 ('4', 3),
 ('5', 1),
 ('50', 1),
 ('501c3', 1),
 ('596-1887', 1),
 ('60', 1),
 ('64-6221541', 1),
 ('750175', 1),
 ('801', 1),
 ('809', 1),
 ('84116', 1),
 ('90', 2),
 ('99775', 1),
 ('a', 607),
 ('a-cursing', 1),
 ('a-down', 1),
 ('a-down-a’', 1),
 ('a-foot', 1),
 ('a-making', 1),
 ('a-work', 1),
 ('abate', 1),
 ('abatements', 1),
 ('abhorred', 1),
 ('abide', 1),
 ('able', 1),
 ('aboard', 3),
 ('abominably', 1),
 ('about', 26),
 ('above', 4),
 ('abridgement', 1),
 ('abroad', 1),
 ('absent', 1),
 ('absolute', 2),
 ('abstinence', 1),
 ('abstracts', 1),
 ('absurd', 2),
 ('abuse', 1),
 ('abuses', 1),
 ('abus’d', 1),
 ('accent', 2),
 ('accept', 1),
 ('accepted', 2),
 ('accepting', 1),
 ('accepts', 1),
 ('access', 11),
 ('accessed', 1),
 ('accessible', 1),
 ('accident', 3),
 ('accidental', 1),
 ('accidents', 1),
 ('accord', 1),
 ('accordance', 2),
 ('according', 2),
 ('account', 1),
 ('accounted', 1),
 ('accurst', 1),
 ('accuse', 1),
 ('ache', 1),
 ('achievements', 1),
 ('acquaint', 1),
 ('acquire', 1),
 ('acquittance', 1),
 ('acres', 1),
 ('across', 1),
 ('act', 24),
 ('acted', 1),
 ('acting', 1),
 ('action', 10),
 ('actions', 2),
 ('active', 2),
 ('actively', 1),
 ('actor', 3),
 ('actors', 2),
 ('acts', 2),
 ('actual', 1),
 ('adam', 1),
 ('adam’s', 1),
 ('adders', 1),
 ('addicted', 1),
 ('addition', 4),
 ('additional', 4),
 ('additions', 1),
 ('address', 3),
 ('addresses', 1),
 ('adheres', 1),
 ('adieu', 7),
 ('adjoin’d', 1),
 ('admirable', 1),
 ('admiration', 3),
 ('admit', 2),
 ('admittance', 1),
 ('adoption', 1),
 ('adulterate', 1),
 ('advancement', 2),
 ('advances', 1),
 ('advancing', 1),
 ('advanc’d', 1),
 ('advantage', 1),
 ('adventurous', 1),
 ('advice', 3),
 ('advise', 1),
 ('aeneas’', 1),
 ('afar', 1),
 ('afeard', 1),
 ('affair', 3),
 ('affairs', 1),
 ('affectation', 1),
 ('affection', 4),
 ('affections', 1),
 ('afflict', 1),
 ('affliction', 2),
 ('afflicts', 1),
 ('affrighted', 1),
 ('affront', 1),
 ('afraid', 1),
 ('after', 14),
 ('afternoon', 1),
 ('afterwards', 1),
 ('again', 32),
 ('against', 24),
 ('again—what', 1),
 ('age', 9),
 ('agent', 1),
 ('ago', 1),
 ('agree', 9),
 ('agreed', 1),
 ('agreeing', 1),
 ('agreement', 18),
 ('ah', 3),
 ('aid', 1),
 ('aim', 1),
 ('aim’d', 1),
 ('air', 12),
 ('airs', 1),
 ('airy', 1),
 ('ak', 1),
 ('alack', 3),
 ('alarm', 1),
 ('alas', 11),
 ('alaska', 1),
 ('alexander', 5),
 ('all', 137),
 ('allegiance', 1),
 ('alleys', 1),
 ('allow', 2),
 ('allowance', 2),
 ('allowed', 1),
 ('allow’d', 1),
 ('all—', 1),
 ('all’s', 2),
 ('almost', 12),
 ('alone', 10),
 ('along', 3),
 ('aloof', 2),
 ('already', 7),
 ('also', 3),
 ('alteration', 1),
 ('alternate', 1),
 ('altitude', 1),
 ('altogether', 1),
 ('always', 1),
 ('am', 55),
 ('amaze', 1),
 ('amazement', 2),
 ('amaz’d', 1),
 ('ambassador', 1),
 ('ambassadors', 3),
 ('amber', 1),
 ('ambiguous', 1),
 ('ambition', 6),
 ('ambitious', 2),
 ('amble', 1),
 ('amen', 1),
 ('amiss', 2),
 ('amities', 1),
 ('among', 1),
 ('an', 55),
 ('anchor’s', 1),
 ('ancient', 1),
 ('and', 1051),
 ('and’t', 1),
 ('angel', 4),
 ('angels', 3),
 ('anger', 1),
 ('angle', 1),
 ('angry', 1),
 ('animals', 1),
 ('ankle', 1),
 ('annexment', 1),
 ('annual', 1),
 ('anoint', 1),
 ('anon', 6),
 ('another', 20),
 ('another’s', 1),
 ('answer', 14),
 ('answerest', 1),
 ('answer’d', 1),
 ('antic', 1),
 ('anticipation', 1),
 ('antique', 2),
 ('antiquity', 1),
 ('any', 49),
 ('anyone', 5),
 ('anything', 7),
 ('anywhere', 2),
 ('apart', 2),
 ('ape', 2),
 ('apiece', 1),
 ('apoplex’d', 1),
 ('appal', 1),
 ('apparel', 1),
 ('apparition', 2),
 ('appear', 4),
 ('appearing', 1),
 ('appears', 4),
 ('appear’d', 3),
 ('appetite', 1),
 ('applaud', 1),
 ('appliance', 1),
 ('applicable', 3),
 ('apply', 1),
 ('appointment', 1),
 ('apprehension', 2),
 ('approach', 1),
 ('approve', 2),
 ('appurtenance', 1),
 ('apt', 2),
 ('aptly', 1),
 ('archive', 13),
 ('ardour', 1),
 ('are', 154),
 ('argal', 3),
 ('argues', 1),
 ('argument', 4),
 ('aright', 1),
 ('arise', 1),
 ('arm', 5),
 ('armed', 3),
 ('armour', 3),
 ('arms', 9),
 ('army', 1),
 ('arm’d', 2),
 ('aroused', 1),
 ('arraign', 1),
 ('arrant', 2),
 ('arras', 5),
 ('array', 1),
 ('arrests', 1),
 ('arrest—o', 1),
 ('arriv’d', 1),
 ('arrow', 1),
 ('arrows', 2),
 ('art', 17),
 ('artery', 1),
 ('article', 2),
 ('articles', 1),
 ('artless', 1),
 ('as', 230),
 ('as-is', 1),
 ('ascii', 2),
 ('ashamed', 1),
 ('aside', 11),
 ('ask', 2),
 ('asked', 1),
 ('asking', 2),
 ('aslant', 1),
 ('asleep', 2),
 ('aspect', 1),
 ('ass', 3),
 ('assail', 1),
 ('assault', 1),
 ('assay', 2),
 ('assays', 1),
 ('assay’d', 1),
 ('assigns', 2),
 ('assistance', 1),
 ('assistant', 2),
 ('associated', 8),
 ('assume', 3),
 ('assurance', 2),
 ('assure', 1),
 ('assur’d', 2),
 ('ass—', 1),
 ('asunder', 1),
 ('at', 100),
 ('attached', 1),
 ('attend', 1),
 ('attendant', 1),
 ('attendants', 8),
 ('attended', 2),
 ('attends', 1),
 ('attent', 1),
 ('attractive', 1),
 ('attribute', 1),
 ('audience', 5),
 ('audit', 1),
 ('aught', 9),
 ('aught—', 1),
 ('augury', 1),
 ('aunt-mother', 1),
 ('auspicious', 1),
 ('author', 3),
 ('authorities', 1),
 ('available', 2),
 ('avoid', 3),
 ('avouch', 1),
 ('awake', 2),
 ('away', 27),
 ('away--you', 1),
 ('away—go', 1),
 ('awe', 2),
 ('awhile', 10),
 ('awry', 1),
 ('axe', 2),
 ('ay', 37),
 ('aye', 1),
 ('ayry', 1),
 ('a’', 1),
 ('b', 2),
 ('babe', 1),
 ('baby', 2),
 ('back', 8),
 ('backed', 1),
 ('backward', 1),
 ('bad', 6),
 ('bade', 1),
 ('bait', 1),
 ('baker’s', 1),
 ('bak’d', 2),
 ('ban', 1),
 ('bands', 1),
 ('bank', 1),
 ('baptista', 1),
 ('bar', 1),
 ('barbary', 2),
 ('barber’s', 1),
 ('bare', 1),
 ('barefac’d', 1),
 ('barefoot', 1),
 ('bark', 1),
 ('bark’d', 1),
 ('barnardo', 30),
 ('barren', 1),
 ('barr’d', 1),
 ('base', 5),
 ('based', 2),
 ('baseness', 1),
 ('baser', 2),
 ('basket', 2),
 ('bastard', 1),
 ('bat', 2),
 ('bated', 1),
 ('battalions', 1),
 ('batten', 1),
 ('battery', 1),
 ('battlements', 1),
 ('bawd', 1),
 ('bawdry', 1),
 ('bawds', 1),
 ('bawdy', 1),
 ('be', 239),
 ('beam', 1),
 ('bean', 2),
 ('bear', 14),
 ('beard', 5),
 ('beards', 1),
 ('beard—prythee', 1),
 ('bearers', 2),
 ('bearing', 1),
 ('bears', 2),
 ('bear’t', 1),
 ('beast', 5),
 ('beasts', 2),
 ('beast—', 1),
 ('beaten', 1),
 ('beating', 3),
 ('beats', 1),
 ('beauteous', 1),
 ('beautied', 1),
 ('beauties', 1),
 ('beautified', 1),
 ('beauty', 6),
 ('beaver', 1),
 ('became', 1),
 ('because', 2),
 ('beck', 1),
 ('beckons', 3),
 ('becomes', 3),
 ('bed', 11),
 ('bed-rid', 1),
 ('bedded', 1),
 ('beds', 1),
 ('been', 28),
 ('beer-barrel', 1),
 ('beetles', 1),
 ('befall’n', 1),
 ('befitted', 1),
 ('before', 26),
 ('beg', 7),
 ('beget', 1),
 ('beggar', 3),
 ('beggars', 1),
 ('beggars’', 1),
 ('beggar’d', 1),
 ('begin', 5),
 ('beginning', 1),
 ('begins', 2),
 ('beguile', 2),
 ('begun', 4),
 ('behaviour', 2),
 ('behav’d', 1),
 ('behind', 9),
 ('behold', 1),
 ('behove', 1),
 ('behoves', 1),
 ('being', 12),
 ('belief', 1),
 ('believe', 19),
 ('believed', 1),
 ('belike', 2),
 ('bell', 2),
 ('bellow', 1),
 ('bellowed', 1),
 ('bells', 1),
 ('belov’d', 1),
 ('below', 6),
 ('bend', 3),
 ('bended', 1),
 ('beneath', 4),
 ('benefit', 1),
 ('benetted', 1),
 ('bent', 2),
 ('bent—i', 1),
 ('berattle', 1),
 ('beseech', 7),
 ('beseech’d', 1),
 ('beshrew', 1),
 ('besides', 1),
 ('besmirch', 1),
 ('bespeak', 1),
 ('best', 11),
 ('bestial', 1),
 ('bestow', 4),
 ('bestowed', 1),
 ('bestow’d', 1),
 ('bet', 1),
 ('beteem', 1),
 ('bethought', 1),
 ('betime', 1),
 ('betimes', 1),
 ('betoken', 1),
 ('better', 14),
 ('better—their', 1),
 ('better’d', 1),
 ('between', 15),
 ('bevy', 1),
 ('beware', 2),
 ('bewept', 1),
 ('beyond', 2),
 ('be’', 1),
 ('bias', 1),
 ('bid', 6),
 ('bier', 1),
 ('bilboes', 1),
 ('binary', 1),
 ('bird', 2),
 ('birds', 1),
 ('birth', 4),
 ('bisson', 1),
 ('bites', 1),
 ('bitter', 3),
 ('black', 8),
 ('blackest', 1),
 ('blame', 3),
 ('blank', 2),
 ('blanket', 1),
 ('blanks', 1),
 ('blast', 2),
 ('blasted', 2),
 ('blasting', 1),
 ('blastments', 1),
 ('blasts', 1),
 ('blaze', 1),
 ('blazes', 1),
 ('blazon', 1),
 ('bleed', 2),
 ('bleeding', 1),
 ('blench', 1),
 ('bless', 3),
 ('blessing', 5),
 ('bles’d', 2),
 ('blister', 1),
 ('bloat', 1),
 ('blood', 19),
 ('bloodily', 1),
 ('bloody', 7),
 ('blossoms', 1),
 ('blow', 3),
 ('blown', 2),
 ('blows', 2),
 ('blue', 1),
 ('blunted', 1),
 ('blurs', 1),
 ('blush', 2),
 ('board', 1),
 ('boarded', 1),
 ('bodes', 1),
 ('bodies', 6),
 ('bodikin', 1),
 ('bodiless', 1),
 ('bodkin', 1),
 ('body', 17),
 ('boist’rous', 1),
 ('bold', 3),
 ('bonds', 1),
 ('bones', 4),
 ('bonnet', 1),
 ('bonny', 1),
 ('book', 2),
 ('books', 1),
 ('bore', 4),
 ('born', 2),
 ('borne', 3),
 ('born—he', 1),
 ('borrower', 1),
 ('borrowing', 1),
 ('borrow’d', 1),
 ('bosom', 4),
 ('botch', 1),
 ('both', 30),
 ('boughs', 1),
 ('bought', 1),
 ('bound', 7),
 ('bounded', 1),
 ('bounds', 1),
 ('bounteous', 1),
 ('bounty', 1),
 ('bourn', 1),
 ('bout', 1),
 ('bouts', 1),
 ('bow', 3),
 ('bowl', 1),
 ('box', 2),
 ('boy', 3),
 ('boys', 1),
 ('brain', 6),
 ('brainish', 1),
 ('brains', 5),
 ('branches', 1),
 ('brands', 1),
 ('brave', 3),
 ('bravery', 1),
 ('bray', 1),
 ('brazen', 1),
 ('braz’d', 1),
 ('breach', 3),
 ('bread', 1),
 ('breadth', 1),
 ('break', 8),
 ('breaking', 2),
 ('breaks', 2),
 ('breast', 1),
 ('breath', 9),
 ('breathe', 4),
 ('breathes', 1),
 ('breathing', 2),
 ('breed', 2),
 ('breeder', 1),
 ('breeding', 1),
 ('brevity', 1),
 ('bride-bed', 1),
 ('brief', 5),
 ('bring', 12),
 ('bringing', 1),
 ('brings', 1),
 ('broad', 2),
 ('broke', 2),
 ('broken', 1),
 ('brokers', 1),
 ('brooch', 1),
 ('brood', 1),
 ('brook', 2),
 ('brothel', 1),
 ('brother', 9),
 ('brothers', 2),
 ('brother’s', 7),
 ('brought', 6),
 ('brow', 4),
 ('brows', 1),
 ('bruit', 1),
 ('brute', 1),
 ('brutus', 1),
 ('bubbles', 1),
 ('budge', 1),
 ('buffets', 1),
 ('bugs', 1),
 ('build', 1),
 ('builds', 2),
 ('built', 1),
 ('bulk', 2),
 ('bulwark', 1),
 ('bung-hole', 1),
 ('burden', 1),
 ('burial', 4),
 ('burial—', 1),
 ('buried', 6),
 ('burn', 2),
 ('burning', 2),
 ('burns', 2),
 ('burnt', 1),
 ('burst', 3),
 ('business', 12),
 ('busy', 1),
 ('but', 273),
 ('button', 1),
 ('buttons', 1),
 ('but’', 1),
 ('buy', 1),
 ('buyer', 1),
 ('buys', 1),
 ('buzz', 2),
 ('buzzers', 1),
 ('by', 144),
 ('by—they', 1),
 ('by’r', 2),
 ('b’', 4),
 ('c', 1),
 ('cabin', 1),
 ('caesar', 2),
 ('cain’s', 1),
 ('calamity', 1),
 ('calculate', 1),
 ('calculated', 1),
 ('calendar', 1),
 ('calf', 1),
 ('calf-skins', 1),
 ('call', 22),
 ('called', 1),
 ('calls', 4),
 ('call’d', 1),
 ('call’t', 1),
 ('calm', 2),
 ('calmly', 1),
 ('calumnious', 1),
 ('calumny', 1),
 ('calves', 1),
 ('came', 9),
 ('camel', 2),
 ('can', 44),
 ('candied', 1),
 ('canker', 2),
 ('cannon', 5),
 ('cannoneer', 1),
 ('cannons', 1),
 ('cannot', 33),
 ('canon', 1),
 ('canoniz’d', 1),
 ('canopy', 1),
 ('canst', 3),
 ('cap', 2),
 ('cap-à-pie', 1),
 ('capability', 1),
 ('capable', 1),
 ('capable—do', 1),
 ('capital', 2),
 ('capitol', 1),
 ('capons', 1),
 ('caps', 1),
 ('captain', 10),
 ('captains', 1),
 ('carbuncles', 1),
 ('card', 3),
 ('carefully', 1),
 ('careless', 1),
 ('carnal', 1),
 ('carouses', 1),
 ('carp', 1),
 ('carpenter', 2),
 ('carriage', 1),
 ('carriages', 5),
 ('carried', 1),
 ('carries', 1),
 ('carrion—', 1),
 ('carry', 4),
 ('carrying', 1),
 ('cart', 1),
 ('carters', 1),
 ('carve', 1),
 ('case', 1),
 ('cases', 1),
 ('cast', 6),
 ('castle', 30),
 ('casual', 1),
 ('cat', 1),
 ('cataplasm', 1),
 ('catch', 2),
 ('caught', 2),
 ('cause', 19),
 ('cautel', 1),
 ('caution—i', 1),
 ('caviare', 1),
 ('cease', 3),
 ('celebrated', 1),
 ('celestial', 2),
 ('cell', 1),
 ('cellarage', 1),
 ('censure', 4),
 ('centre', 1),
 ('cerements', 1),
 ('ceremony', 3),
 ('certain', 7),
 ('certainty', 1),
 ('chalice', 1),
 ('challenger', 1),
 ('chamber', 4),
 ('chamberlain', 1),
 ('chameleon’s', 1),
 ('chance', 2),
 ('chances', 2),
 ('change', 5),
 ('changed', 1),
 ('changeling', 1),
 ('changes', 1),
 ('chanson', 1),
 ('chapel', 2),
 ('chapless', 1),
 ('character', 3),
 ('charge', 14),
 ('charges', 1),
 ('chariest', 1),
 ('charitable', 3),
 ('charities', 1),
 ('charity', 1),
 ('charm', 1),
 ('chase', 1),
 ('chaste', 3),
 ('chaunted', 1),
 ('check', 4),
 ('checking', 1),
 ('checks', 1),
 ('cheek', 2),
 ('cheer', 3),
 ('cheerfully', 2),
 ('cherub', 1),
 ('chide', 1),
 ('chief', 4),
 ('chiefest', 1),
 ('chiefly', 1),
 ('child', 2),
 ('children', 3),
 ('choice', 6),
 ('choler', 2),
 ('choose', 5),
 ('chop-fallen', 1),
 ('chopine', 1),
 ('chorus', 1),
 ('chough', 1),
 ('christian', 6),
 ('christians', 1),
 ('chronicles', 1),
 ('church', 2),
 ('churches', 1),
 ('churchyard', 2),
 ('churchyards', 1),
 ('churlish', 1),
 ('cicatrice', 1),
 ('circumscrib’d', 1),
 ('circumstance', 6),
 ('circumstances', 1),
 ('circumvent', 1),
 ('city', 3),
 ('clad', 1),
 ('claim', 2),
 ('clamb’ring', 1),
 ('clamour', 1),
 ('clapped', 1),
 ('claudio', 1),
 ('claudius', 3),
 ('claw’d', 1),
 ('clay', 3),
 ('clear', 1),
 ('clearly', 2),
 ('cleave', 1),
 ('cleft', 1),
 ('clemency', 1),
 ('clepe', 1),
 ('cliff', 1),
 ('climatures', 1),
 ('cloak', 1),
 ('close', 3),
 ('closely', 1),
 ('closes', 2),
 ('closet', 3),
 ('clothe', 1),
 ('clothes', 2),
 ('cloud', 1),
 ('clouds', 4),
 ('clout', 1),
 ('clouts', 1),
 ('clown', 47),
 ('clowns', 3),
 ('clutch', 1),
 ('co-mingled', 1),
 ('coach', 1),
 ('coagulate', 1),
 ('cock', 6),
 ('cockle', 1),
 ('codes', 1),
 ('coil', 1),
 ('coinage', 1),
 ('cold', 6),
 ('coldly', 2),
 ('collateral', 1),
 ('colleagued', 1),
 ('collected', 2),
 ('collection', 6),
 ('colour', 5),
 ('columbines', 1),
 ('combat', 1),
 ('combated', 1),
 ('combination', 1),
 ('combined', 1),
 ('come', 106),
 ('comedy', 2),
 ('comes', 24),
 ('comfort', 1),
 ('coming', 7),
 ('comma', 1),
 ('command', 10),
 ('commanded', 1),
 ('commandment', 4),
 ('commands', 1),
 ('commencement', 1),
 ('commend', 4),
 ('commendable', 1),
 ('commended', 1),
 ('comment', 1),
 ('commerce', 1),
 ('commercial', 1),
 ('commission', 5),
 ('committed', 1),
 ('common', 7),
 ('commune', 1),
 ('commutual', 1),
 ('compact', 1),
 ('companies', 1),
 ('companions', 1),
 ('company', 1),
 ('compare', 1),
 ('compass', 1),
 ('compelled', 1),
 ('compell’d', 1),
 ('competent', 1),
 ('compilation', 1),
 ('complete', 1),
 ('complexion', 3),
 ('compliance', 5),
 ('comply', 8),
 ('complying', 3),
 ('compost', 1),
 ('compos’d', 1),
 ('compound', 1),
 ('compounded', 1),
 ('compressed', 1),
 ('compulsatory', 1),
 ('compulsive', 1),
 ('computer', 2),
 ('computers', 2),
 ('comrade', 1),
 ('com’st', 2),
 ('conceal’d', 1),
 ('conceit', 5),
 ('conceited', 1),
 ('conceive', 1),
 ('concept', 2),
 ('conception', 1),
 ('concernancy', 1),
 ('concerning', 2),
 ('concernings', 1),
 ('concluded', 1),
 ('conclusions', 1),
 ('condolement', 1),
 ('confederate', 1),
 ('conference', 1),
 ('confess', 6),
 ('confession', 3),
 ('confine', 2),
 ('confines', 1),
 ('confin’d', 1),
 ('confirmation', 1),
 ('confirmed', 1),
 ('confound', 2),
 ('confront', 1),
 ('confusion', 1),
 ('congregation', 1),
 ('conjectures', 1),
 ('conjoin’d', 1),
 ('conjunctive', 1),
 ('conjuration', 1),
 ('conjure', 1),
 ('conjures', 1),
 ('conjuring', 1),
 ('conqueror', 1),
 ('conquest', 1),
 ('conscience', 8),
 ('consent', 4),
 ('consequence', 2),
 ('consequence’', 2),
 ('consequential', 1),
 ('consider', 2),
 ('considerable', 2),
 ('considered', 1),
 ('consider’d', 1),
 ('consonancy', 1),
 ('constant', 2),
 ('constantly', 1),
 ('consummation', 1),
 ('contact', 4),
 ('contagion', 2),
 ('contagious', 1),
 ('contain', 2),
 ('containing', 2),
 ('contend', 1),
 ('content', 3),
 ('contents', 2),
 ('continent', 2),
 ('continual', 1),
 ('contract', 2),
 ('contracted', 1),
 ('contraction', 1),
 ('contrary', 1),
 ('contributions', 2),
 ('contrive', 2),
 ('contriving', 1),
 ('controversy', 1),
 ('contumely', 1),
 ('convenience', 1),
 ('conveniently', 1),
 ('conversation', 1),
 ('converse', 1),
 ('convert', 3),
 ('converted', 1),
 ('convey', 1),
 ('conveyance', 1),
 ('conveyances', 1),
 ('convocation', 1),
 ('convoy', 1),
 ('cool', 1),
 ('copied', 3),
 ('copies', 7),
 ('copy', 12),
 ('copying', 4),
 ('copyright', 19),
 ('cop’d', 1),
 ('core', 1),
 ('cornelius', 7),
 ('corner', 1),
 ('coronation', 1),
 ('coronet', 1),
 ('corporation', 1),
 ...]
In [99]:
# sort by arbitrary function of elements
def second(x): return x[1]
sorted(wcl,key=second,reverse=True)
Out[99]:
[('the', 1300),
 ('and', 1051),
 ('to', 818),
 ('of', 800),
 ('you', 623),
 ('a', 607),
 ('i', 545),
 ('my', 516),
 ('in', 510),
 ('hamlet', 463),
 ('it', 430),
 ('that', 402),
 ('is', 362),
 ('this', 347),
 ('not', 339),
 ('with', 317),
 ('his', 297),
 ('but', 273),
 ('for', 273),
 ('your', 251),
 ('be', 239),
 ('me', 233),
 ('as', 230),
 ('lord', 220),
 ('he', 219),
 ('what', 204),
 ('him', 195),
 ('king', 194),
 ('so', 193),
 ('or', 190),
 ('have', 187),
 ('will', 176),
 ('do', 166),
 ('are', 154),
 ('horatio', 154),
 ('no', 153),
 ('we', 147),
 ('by', 144),
 ('on', 138),
 ('all', 137),
 ('if', 135),
 ('our', 123),
 ('polonius', 120),
 ('queen', 117),
 ('shall', 116),
 ('from', 111),
 ('o', 110),
 ('come', 106),
 ('good', 105),
 ('they', 105),
 ('laertes', 104),
 ('thou', 102),
 ('at', 100),
 ('more', 99),
 ('now', 98),
 ('let', 94),
 ('how', 93),
 ('her', 91),
 ('project', 89),
 ('most', 87),
 ('may', 86),
 ('was', 86),
 ('thy', 86),
 ('ophelia', 86),
 ('like', 80),
 ('would', 79),
 ('rosencrantz', 78),
 ('there', 78),
 ('us', 77),
 ('them', 75),
 ('know', 75),
 ('well', 74),
 ('’tis', 73),
 ('sir', 72),
 ('which', 70),
 ('go', 70),
 ('must', 69),
 ('enter', 68),
 ('did', 66),
 ('guildenstern', 66),
 ('very', 66),
 ('love', 66),
 ('hath', 64),
 ('give', 63),
 ('then', 63),
 ('first', 63),
 ('speak', 62),
 ('such', 61),
 ('why', 60),
 ('where', 60),
 ('make', 58),
 ('thee', 58),
 ('out', 57),
 ('their', 57),
 ('should', 57),
 ('i’ll', 57),
 ('when', 56),
 ('gutenberg-tm', 56),
 ('upon', 56),
 ('work', 55),
 ('some', 55),
 ('an', 55),
 ('am', 55),
 ('here', 53),
 ('say', 53),
 ('than', 53),
 ('these', 52),
 ('man', 51),
 ('too', 51),
 ('father', 51),
 ('much', 50),
 ('any', 49),
 ('see', 48),
 ('clown', 47),
 ('marcellus', 47),
 ('she', 46),
 ('who', 46),
 ('think', 46),
 ('one', 45),
 ('can', 44),
 ('scene', 44),
 ('had', 44),
 ('time', 43),
 ('heaven', 43),
 ('yet', 42),
 ('tell', 42),
 ('thus', 40),
 ('mother', 39),
 ('up', 39),
 ('exit', 38),
 ('own', 38),
 ('nor', 37),
 ('ay', 37),
 ('look', 37),
 ('death', 37),
 ('take', 35),
 ('exeunt', 35),
 ('night', 35),
 ('play', 35),
 ('soul', 34),
 ('hear', 34),
 ('could', 33),
 ('osric', 33),
 ('cannot', 33),
 ('works', 33),
 ('life', 33),
 ('again', 32),
 ('ghost', 32),
 ('into', 32),
 ('god', 31),
 ('dead', 31),
 ('indeed', 31),
 ('whose', 31),
 ('within', 31),
 ('might', 31),
 ('set', 31),
 ('gutenberg', 31),
 ('mine', 31),
 ('part', 30),
 ('both', 30),
 ('castle', 30),
 ('nothing', 30),
 ('barnardo', 30),
 ('made', 29),
 ('pray', 29),
 ('other', 29),
 ('heart', 29),
 ('room', 28),
 ('hold', 28),
 ('down', 28),
 ('been', 28),
 ('dear', 28),
 ('without', 28),
 ('leave', 28),
 ('electronic', 27),
 ('were', 27),
 ('does', 27),
 ('doth', 27),
 ('away', 27),
 ('use', 27),
 ('nature', 27),
 ('never', 26),
 ('sweet', 26),
 ('about', 26),
 ('before', 26),
 ('world', 26),
 ('great', 26),
 ('terms', 26),
 ('matter', 26),
 ('head', 26),
 ('denmark', 25),
 ('nay', 25),
 ('second', 25),
 ('even', 25),
 ('comes', 24),
 ('itself', 24),
 ('though', 24),
 ('put', 24),
 ('full', 24),
 ('against', 24),
 ('act', 24),
 ('show', 23),
 ('means', 23),
 ('eyes', 23),
 ('true', 23),
 ('those', 22),
 ('foundation', 22),
 ('call', 22),
 ('old', 22),
 ('seen', 22),
 ('i’', 22),
 ('two', 22),
 ('follow', 22),
 ('madness', 22),
 ('done', 21),
 ('himself', 21),
 ('fortinbras', 21),
 ('state', 21),
 ('fair', 21),
 ('day', 21),
 ('off', 21),
 ('mad', 21),
 ('keep', 20),
 ('many', 20),
 ('earth', 20),
 ('players', 20),
 ('friends', 20),
 ('player', 20),
 ('states', 20),
 ('fear', 20),
 ('still', 20),
 ('hand', 20),
 ('another', 20),
 ('england', 20),
 ('poor', 20),
 ('words', 20),
 ('till', 20),
 ('son', 20),
 ('reynaldo', 19),
 ('cause', 19),
 ('copyright', 19),
 ('believe', 19),
 ('end', 19),
 ('once', 19),
 ('blood', 19),
 ('makes', 19),
 ('gentleman', 18),
 ('little', 18),
 ('long', 18),
 ('agreement', 18),
 ('father’s', 18),
 ('since', 18),
 ('there’s', 18),
 ('thing', 17),
 ('ear', 17),
 ('thoughts', 17),
 ('young', 17),
 ('is’t', 17),
 ('else', 17),
 ('find', 17),
 ('noble', 17),
 ('art', 17),
 ('form', 17),
 ('body', 17),
 ('th’', 17),
 ('farewell', 17),
 ('faith', 17),
 ('majesty', 16),
 ('speech', 16),
 ('question', 16),
 ('free', 16),
 ('license', 16),
 ('watch', 16),
 ('sword', 16),
 ('that’s', 16),
 ('marry', 16),
 ('stand', 16),
 ('youth', 16),
 ('welcome', 16),
 ('has', 16),
 ('hast', 16),
 ('therefore', 15),
 ('please', 15),
 ('live', 15),
 ('between', 15),
 ('help', 15),
 ('tongue', 15),
 ('said', 15),
 ('right', 15),
 ('eye', 15),
 ('drink', 15),
 ('forth', 15),
 ('rest', 15),
 ('united', 15),
 ('last', 15),
 ('donations', 15),
 ('daughter', 15),
 ('something', 15),
 ('gone', 14),
 ('law', 14),
 ('grief', 14),
 ('grace', 14),
 ('charge', 14),
 ('o’er', 14),
 ('spirit', 14),
 ('sings', 14),
 ('heard', 14),
 ('mark', 14),
 ('after', 14),
 ('sent', 14),
 ('yourself', 14),
 ('lady', 14),
 ('phrase', 14),
 ('purpose', 14),
 ('reason', 14),
 ('thine', 14),
 ('dost', 14),
 ('while', 14),
 ('better', 14),
 ('answer', 14),
 ('bear', 14),
 ('same', 13),
 ('ho', 13),
 ('ever', 13),
 ('gertrude', 13),
 ('goes', 13),
 ('virtue', 13),
 ('none', 13),
 ('we’ll', 13),
 ('way', 13),
 ('ebook', 13),
 ('norway', 13),
 ('kind', 13),
 ('literary', 13),
 ('duty', 13),
 ('things', 13),
 ('sense', 13),
 ('haste', 13),
 ('archive', 13),
 ('further', 13),
 ('murder', 12),
 ('air', 12),
 ('almost', 12),
 ('mind', 12),
 ('ere', 12),
 ('word', 12),
 ('madam', 12),
 ('sleep', 12),
 ('grave', 12),
 ('being', 12),
 ('ourselves', 12),
 ('hamlet’s', 12),
 ('each', 12),
 ('together', 12),
 ('gentlemen', 12),
 ('fit', 12),
 ('oft', 12),
 ('business', 12),
 ('what’s', 12),
 ('bring', 12),
 ('e’en', 12),
 ('revenge', 12),
 ('name', 12),
 ('copy', 12),
 ('voice', 12),
 ('saw', 12),
 ('fire', 12),
 ('hands', 12),
 ('friend', 12),
 ('ii', 12),
 ('alas', 11),
 ('aside', 11),
 ('through', 11),
 ('fortune', 11),
 ('thousand', 11),
 ('remember', 11),
 ('thought', 11),
 ('takes', 11),
 ('trademark', 11),
 ('foul', 11),
 ('wind', 11),
 ('face', 11),
 ('stay', 11),
 ('fee', 11),
 ('doubt', 11),
 ('given', 11),
 ('elsinore', 11),
 ('honest', 11),
 ('passion', 11),
 ('men', 11),
 ('’twere', 11),
 ('francisco', 11),
 ('tonight', 11),
 ('bed', 11),
 ('deed', 11),
 ('under', 11),
 ('access', 11),
 ('best', 11),
 ('late', 11),
 ('paragraph', 11),
 ('villain', 11),
 ('far', 11),
 ('memory', 10),
 ('neither', 10),
 ('uncle', 10),
 ('particular', 10),
 ('alone', 10),
 ('awhile', 10),
 ('receive', 10),
 ('peace', 10),
 ('place', 10),
 ('meet', 10),
 ('mean', 10),
 ('days', 10),
 ('command', 10),
 ('refund', 10),
 ('action', 10),
 ('laws', 10),
 ('myself', 10),
 ('captain', 10),
 ('thanks', 10),
 ('let’s', 10),
 ('ears', 10),
 ('near', 10),
 ('lie', 10),
 ('honour', 10),
 ('news', 10),
 ('he’s', 10),
 ('ground', 10),
 ('hell', 10),
 ('skull', 10),
 ('excellent', 10),
 ('in’t', 10),
 ('seem', 10),
 ('fine', 10),
 ('general', 10),
 ('information', 9),
 ('thank', 9),
 ('light', 9),
 ('brother', 9),
 ('wife', 9),
 ('lay', 9),
 ('do’t', 9),
 ('breath', 9),
 ('draw', 9),
 ('agree', 9),
 ('behind', 9),
 ('swear', 9),
 ('voltemand', 9),
 ('get', 9),
 ('o’', 9),
 ('seek', 9),
 ('judgment', 9),
 ('strange', 9),
 ('walk', 9),
 ('sure', 9),
 ('shows', 9),
 ('arms', 9),
 ('came', 9),
 ('age', 9),
 ('fall', 9),
 ('aught', 9),
 ('soft', 9),
 ('sight', 9),
 ('hope', 9),
 ('fell', 9),
 ('custom', 9),
 ('lost', 9),
 ('falls', 9),
 ('courtier', 9),
 ('here’s', 8),
 ('found', 8),
 ('known', 8),
 ('fellow', 8),
 ('grow', 8),
 ('including', 8),
 ('freely', 8),
 ('joy', 8),
 ('on’t', 8),
 ('pale', 8),
 ('gave', 8),
 ('heavens', 8),
 ('understand', 8),
 ('fashion', 8),
 ('shame', 8),
 ('wilt', 8),
 ('attendants', 8),
 ('comply', 8),
 ('conscience', 8),
 ('shot', 8),
 ('service', 8),
 ('to’t', 8),
 ('break', 8),
 ('times', 8),
 ('says', 8),
 ('black', 8),
 ('back', 8),
 ('letters', 8),
 ('associated', 8),
 ('ha', 8),
 ('quick', 8),
 ('husband', 8),
 ('king’s', 8),
 ('power', 8),
 ('gives', 8),
 ('unto', 8),
 ('three', 8),
 ('music', 8),
 ('only', 8),
 ('iii', 8),
 ('return', 8),
 ('noise', 8),
 ('lordship', 8),
 ('hither', 8),
 ('woe', 8),
 ('iv', 8),
 ('hour', 8),
 ('provide', 8),
 ('devil', 8),
 ('wherein', 8),
 ('sit', 8),
 ('dies', 8),
 ('read', 8),
 ('sun', 8),
 ('looks', 8),
 ('person', 8),
 ('less', 8),
 ('truly', 8),
 ('rank', 7),
 ('desire', 7),
 ('beseech', 7),
 ('woman', 7),
 ('cornelius', 7),
 ('sound', 7),
 ('loves', 7),
 ('bound', 7),
 ('enough', 7),
 ('fool', 7),
 ('every', 7),
 ('whole', 7),
 ('ebooks', 7),
 ('top', 7),
 ('obey', 7),
 ('seems', 7),
 ('tax', 7),
 ('turn', 7),
 ('whom', 7),
 ('house', 7),
 ('brother’s', 7),
 ('dust', 7),
 ('beg', 7),
 ('paid', 7),
 ('others', 7),
 ('bloody', 7),
 ('country', 7),
 ('permission', 7),
 ('start', 7),
 ('anything', 7),
 ('adieu', 7),
 ('common', 7),
 ('certain', 7),
 ('copies', 7),
 ('tears', 7),
 ('unless', 7),
 ('march', 7),
 ('distributing', 7),
 ('needs', 7),
 ('list', 7),
 ('either', 7),
 ('wholesome', 7),
 ('lose', 7),
 ('offence', 7),
 ('located', 7),
 ('section', 7),
 ('already', 7),
 ('coming', 7),
 ('visit', 7),
 ('sea', 6),
 ('v', 6),
 ('door', 6),
 ('brain', 6),
 ('heavy', 6),
 ('kill’d', 6),
 ('season', 6),
 ('feed', 6),
 ('below', 6),
 ('yours', 6),
 ('fat', 6),
 ('fare', 6),
 ('seal’d', 6),
 ('dare', 6),
 ('sister', 6),
 ('circumstance', 6),
 ('point', 6),
 ('brought', 6),
 ('piece', 6),
 ('struck', 6),
 ('desperate', 6),
 ('effect', 6),
 ('speaks', 6),
 ('lack', 6),
 ('hall', 6),
 ('owner', 6),
 ('try', 6),
 ('double', 6),
 ('proof', 6),
 ('danish', 6),
 ('cold', 6),
 ('sorrow', 6),
 ('pyrrhus', 6),
 ('laid', 6),
 ('health', 6),
 ('foils', 6),
 ('guilty', 6),
 ('new', 6),
 ('slain', 6),
 ('stood', 6),
 ('vile', 6),
 ('whilst', 6),
 ('using', 6),
 ('move', 6),
 ('dull', 6),
 ('fie', 6),
 ('dane', 6),
 ('christian', 6),
 ('home', 6),
 ('cock', 6),
 ('toward', 6),
 ('bid', 6),
 ('except', 6),
 ('whether', 6),
 ('damned', 6),
 ('received', 6),
 ('herself', 6),
 ('distribute', 6),
 ('court', 6),
 ('mother’s', 6),
 ('beauty', 6),
 ('bodies', 6),
 ('wrong', 6),
 ('shape', 6),
 ('prologue', 6),
 ('maid', 6),
 ('lies', 6),
 ('water', 6),
 ('platform', 6),
 ('withal', 6),
 ('ill', 6),
 ('anon', 6),
 ('false', 6),
 ('distribution', 6),
 ('course', 6),
 ('&c', 6),
 ('confess', 6),
 ('laugh', 6),
 ('vows', 6),
 ('truth', 6),
 ('dumb', 6),
 ('wicked', 6),
 ('pardon', 6),
 ('discourse', 6),
 ('mouth', 6),
 ('ambition', 6),
 ('wager', 6),
 ('collection', 6),
 ('poison', 6),
 ('bad', 6),
 ('marriage', 6),
 ('prince', 6),
 ('hot', 6),
 ('note', 6),
 ('crown', 6),
 ('property', 6),
 ('choice', 6),
 ('pass', 6),
 ('buried', 6),
 ('touch', 6),
 ('cast', 6),
 ('hit', 6),
 ('wouldst', 6),
 ('volunteers', 6),
 ('round', 6),
 ('wisdom', 6),
 ('disposition', 5),
 ('silence', 5),
 ('knew', 5),
 ('damn’d', 5),
 ('replacement', 5),
 ('1e1', 5),
 ('shalt', 5),
 ('natural', 5),
 ('keeps', 5),
 ('perhaps', 5),
 ('knave', 5),
 ('mortal', 5),
 ('wit', 5),
 ('holds', 5),
 ('trumpet', 5),
 ('honesty', 5),
 ('warrant', 5),
 ('parts', 5),
 ('messenger', 5),
 ('mass', 5),
 ('web', 5),
 ('slave', 5),
 ('fly', 5),
 ('dream', 5),
 ('hearing', 5),
 ('motive', 5),
 ('table', 5),
 ('cries', 5),
 ('medium', 5),
 ('following', 5),
 ('money', 5),
 ('french', 5),
 ('year', 5),
 ('stir', 5),
 ('servant', 5),
 ('flourish', 5),
 ('hard', 5),
 ('morning', 5),
 ('base', 5),
 ('twelve', 5),
 ('arm', 5),
 ('prison', 5),
 ('save', 5),
 ('commission', 5),
 ('direct', 5),
 ('four', 5),
 ('humbly', 5),
 ('colour', 5),
 ('prepare', 5),
 ('eat', 5),
 ('figure', 5),
 ('perchance', 5),
 ('teach', 5),
 ('fault', 5),
 ('man’s', 5),
 ('whereon', 5),
 ('nunnery', 5),
 ('arras', 5),
 ('compliance', 5),
 ('dangerous', 5),
 ('provided', 5),
 ('send', 5),
 ('fast', 5),
 ('die', 5),
 ('pay', 5),
 ('spirits', 5),
 ('in’s', 5),
 ('half', 5),
 ('audience', 5),
 ('kingdom', 5),
 ('land', 5),
 ('defect', 5),
 ('told', 5),
 ('soldiers', 5),
 ('warlike', 5),
 ('’gainst', 5),
 ('treason', 5),
 ('reads', 5),
 ('conceit', 5),
 ('went', 5),
 ('yes', 5),
 ('hide', 5),
 ('longer', 5),
 ('beard', 5),
 ('next', 5),
 ('cannon', 5),
 ('rather', 5),
 ('gracious', 5),
 ('report', 5),
 ('short', 5),
 ('mercy', 5),
 ('gentle', 5),
 ('brief', 5),
 ('throw', 5),
 ('alexander', 5),
 ('patience', 5),
 ('protected', 5),
 ('wide', 5),
 ('liberty', 5),
 ('sing', 5),
 ('drown’d', 5),
 ('main', 5),
 ('france', 5),
 ('drown', 5),
 ('visage', 5),
 ('star', 5),
 ('souls', 5),
 ('presently', 5),
 ('fortune’s', 5),
 ('plain', 5),
 ('dread', 5),
 ('countenance', 5),
 ('quiet', 5),
 ('1f3', 5),
 ('carriages', 5),
 ('writ', 5),
 ('blessing', 5),
 ('anyone', 5),
 ('’twas', 5),
 ('begin', 5),
 ('moon', 5),
 ('beast', 5),
 ('flesh', 5),
 ('change', 5),
 ('cry', 5),
 ('choose', 5),
 ('sudden', 5),
 ('woul’t', 5),
 ('its', 5),
 ('brains', 5),
 ('themselves', 5),
 ('wwwgutenbergorg', 5),
 ('cost', 5),
 ('need', 5),
 ('limited', 5),
 ('poison’d', 4),
 ('wittenberg', 4),
 ('addition', 4),
 ('sick', 4),
 ('thence', 4),
 ('appear', 4),
 ('draws', 4),
 ('meant', 4),
 ('ye', 4),
 ('deep', 4),
 ('whereto', 4),
 ('pause', 4),
 ('used', 4),
 ('creating', 4),
 ('seeing', 4),
 ('violence', 4),
 ('holder', 4),
 ('bestow', 4),
 ('thrift', 4),
 ('stars', 4),
 ('william', 4),
 ('lest', 4),
 ('breathe', 4),
 ('imagination', 4),
 ('motion', 4),
 ('writing', 4),
 ('thinking', 4),
 ('forgot', 4),
 ('danger', 4),
 ('format', 4),
 ('violent', 4),
 ('cursed', 4),
 ('horrible', 4),
 ('begun', 4),
 ('sailors', 4),
 ('grown', 4),
 ('polack', 4),
 ('damages', 4),
 ('months', 4),
 ('kept', 4),
 ('wild', 4),
 ('died', 4),
 ('you’ll', 4),
 ('infinite', 4),
 ('polonius’s', 4),
 ('modesty', 4),
 ('posted', 4),
 ('chamber', 4),
 ('affection', 4),
 ('providing', 4),
 ('lands', 4),
 ('pate', 4),
 ('length', 4),
 ('follows', 4),
 ('tender', 4),
 ('brow', 4),
 ('native', 4),
 ('site', 4),
 ('pity', 4),
 ('honour’d', 4),
 ('angel', 4),
 ('requirements', 4),
 ('copying', 4),
 ('1e8', 4),
 ('stage', 4),
 ('status', 4),
 ('tend', 4),
 ('priest', 4),
 ('calls', 4),
 ('bones', 4),
 ('public', 4),
 ('clouds', 4),
 ('yea', 4),
 ('stands', 4),
 ('habit', 4),
 ('commend', 4),
 ('weeds', 4),
 ('commandment', 4),
 ('sleeps', 4),
 ('salt', 4),
 ('lords', 4),
 ('spade', 4),
 ('lives', 4),
 ('mission', 4),
 ('ten', 4),
 ('cunning', 4),
 ('editions', 4),
 ('so’', 4),
 ('consent', 4),
 ('treasure', 4),
 ('online', 4),
 ('distributed', 4),
 ('argument', 4),
 ('grows', 4),
 ('trumpets', 4),
 ('instant', 4),
 ('above', 4),
 ('re-enter', 4),
 ('bore', 4),
 ('gross', 4),
 ('hecuba', 4),
 ('danes', 4),
 ('chief', 4),
 ('desires', 4),
 ('quantity', 4),
 ('stop', 4),
 ('sends', 4),
 ('check', 4),
 ('birth', 4),
 ('six', 4),
 ('secret', 4),
 ('fingers', 4),
 ('lend', 4),
 ('quality', 4),
 ('immediate', 4),
 ('straight', 4),
 ('contact', 4),
 ('herein', 4),
 ('return’d', 4),
 ('favour', 4),
 ('weep', 4),
 ('people', 4),
 ('ecstasy', 4),
 ('discretion', 4),
 ('bosom', 4),
 ('beneath', 4),
 ('methinks', 4),
 ('individual', 4),
 ('stronger', 4),
 ('subject', 4),
 ('special', 4),
 ('shakespeare', 4),
 ('wear', 4),
 ('didst', 4),
 ('fees', 4),
 ('fain', 4),
 ('b’', 4),
 ('often', 4),
 ('shortly', 4),
 ('ready', 4),
 ('appears', 4),
 ('strong', 4),
 ('rose', 4),
 ('throat', 4),
 ('sigh', 4),
 ('thyself', 4),
 ('snow', 4),
 ('quite', 4),
 ('puts', 4),
 ('white', 4),
 ('cup', 4),
 ('evil', 4),
 ('twice', 4),
 ('defective', 4),
 ('lights', 4),
 ('methought', 4),
 ('thrice', 4),
 ('hence', 4),
 ('ways', 4),
 ('censure', 4),
 ('support', 4),
 ('sits', 4),
 ('took', 4),
 ('unnatural', 4),
 ('wretched', 4),
 ('wi’', 4),
 ('forget', 4),
 ('leisure', 4),
 ('additional', 4),
 ('years', 4),
 ('warranties', 4),
 ('entertainment', 4),
 ('ease', 4),
 ('burial', 4),
 ('few', 4),
 ('pleasure', 4),
 ('wish', 4),
 ('carry', 4),
 ('remembrance', 4),
 ('lead', 4),
 ('th’earth', 4),
 ('wits', 4),
 ...]
In [101]:
wcl = sorted(wcl,key=lambda x:x[1],reverse=True)  # lambda construct for defining a function inline

Plot of frequency vs rank

In [107]:
import matplotlib.pyplot as plt
%matplotlib inline
from numpy import *
In [108]:
rank = arange(len(wcl)) + 1
freqs = [item[1] for item in wcl]
plt.plot(rank,freqs);
In [105]:
plt.semilogy(rank,freqs);
In [109]:
plt.loglog(rank,freqs);

Zipf's Law