MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: sort list


On Mar 30, 2004, at 4:02 AM, Guibout wrote:

> Hi,
> 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}}
> Thanks for your help
> Vincent
>
>

Sort[{{something1,x1},{something2,x2},{something3,x3}},OrderedQ[{#1[[2]] 
,#2[[2]]}]&]

Regards,

Ssezi


  • Prev by Date: Re: sort list
  • Next by Date: Overflow --> Abort evaluation
  • Previous by thread: sort list
  • Next by thread: Re: sort list