[SciPy-user] Again on Sorting Objects

Alan G Isaac aisaac at american.edu
Mon Jan 21 14:02:59 EST 2008


So ``a`` is already sorted?
Use groupby?

Cheers,
Alan Isaac

>>> from itertools import groupby
>>> for t,v in groupby(a): print list(v)
...
[2]
[3]
[4, 4, 4, 4]
[5]
[6, 6]
[8, 8, 8]
[10, 10]






More information about the SciPy-User mailing list