[SciPy-user] Again on Sorting Objects

Alan G Isaac aisaac@american....
Mon Jan 21 13:02:59 CST 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