[EMAIL PROTECTED] wrote:
> If you can do this, then it is easy to ask python to sort it for you.
>
>
>>>>data = [("NM_004619.2", 4910.8), ("NM_004619.2", 2716.3), ("NM_145759.1",
>
> 4805.7), ("NM_14 5759.1", 2716.3), ("XM_378692.1", 56.00)]
>
>>>>data.sort(key=lambda x: x[1], reverse=True)
You don't need a lambda here, you can use itertools.itemgetter(1). itemgetter()
was added to Python 2.4 for this purpose.
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor