Re: Numeric array in unittest problem

2005-11-21 Thread Roman Bertle
* Alex Martelli <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Sorry Peter, > > > > Try this > > > > import unittest > > import Numeric > > > > class myTest(unittest.TestCase): > > def runTest(self): > > var1 = Numeric.array([1,22]) > > var2 =

groupby and itemgetter

2006-10-06 Thread Roman Bertle
Hello, there is an example how to use groupby in the itertools documentation (http://docs.python.org/lib/itertools-example.html): # 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 = sorted(d.iteritems(), key=