Re: sort list
- To: mathgroup at smc.vnet.net
- Subject: [mg47213] Re: sort list
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Wed, 31 Mar 2004 02:57:33 -0500 (EST)
- References: <c4be1n$702$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Table[{Random[], Random[]},{5}]
Sort[%, #1[[2]]<#2[[2]]&]
Bob Hanlon
In article <c4be1n$702$1 at smc.vnet.net>, Guibout <guibout at ifrance.com> wrote:
<< I have a list of the form
{{something1,x1},{something2,x2},{something3,x3}} where x1,x2, x3 are
numbers. I want to sort this list with respect to xi. In other word if
x2<x3<x1 I want Mathematica to produce:
{{something2,x2},{something3,x3},{something1,x1}}