diff options
Diffstat (limited to 'Doc/lib/libitertools.tex')
-rw-r--r-- | Doc/lib/libitertools.tex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex index 59fb185..a85e048 100644 --- a/Doc/lib/libitertools.tex +++ b/Doc/lib/libitertools.tex @@ -398,7 +398,7 @@ Samuele # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) ->>> di = list.sorted(d.iteritems(), key=itemgetter(1)) +>>> di = sorted(d.iteritems(), key=itemgetter(1)) >>> for k, g in groupby(di, key=itemgetter(1)): ... print k, map(itemgetter(0), g) ... |