[portland] Sorting A List of Tuples

Dylan Reinhardt dylanr at dylanreinhardt.com
Thu Nov 8 18:40:54 CET 2007


Try DSU:

http://www.goldb.org/goldblog/CommentView,guid,6969f8b8-5710-4b4c-ad7a-0f545da805da.aspx

HTH



On 11/8/07, Rich Shepard <rshepard at appl-ecosys.com> wrote:
>
>    All the information I find on sorting lists assumes the list has only a
> single value to be sorted. What to do with multiple values when the sort
> is
> on the second or third item and all must be kept together?
>
>    I have lists of tuples which I'd like to sort on the second item while
> retaining the relationships among the item pairs.
>
>    Could I do
>         terms.sort([][1])
> ?
>
>    A pointer to a reference would be fine.
>
> Rich
>
> --
> Richard B. Shepard, Ph.D.
> |  Integrity            Credibility
> Applied Ecosystem Services, Inc.        |            Innovation
> <http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax:
> 503-667-8863
> _______________________________________________
> Portland mailing list
> Portland at python.org
> http://mail.python.org/mailman/listinfo/portland
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/portland/attachments/20071108/d294271d/attachment.htm 


More information about the Portland mailing list