Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: sort list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47239] Re: sort list
  • From: "Peter Pein" <no at spam.no>
  • Date: Wed, 31 Mar 2004 02:59:43 -0500 (EST)
  • References: <c4be1n$702$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Guibout" <guibout at ifrance.com> schrieb im Newsbeitrag
news:c4be1n$702$1 at smc.vnet.net...
> 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

In[1]:= First /@ Sort[{{works, 3}, {yes, 1}, {it, 2}}, #1[[-1]] < #2[[-1]]
&]
Out[1]= {yes, it, works}

-- 
Peter Pein, Berlin
StringReplace["petsie at arcand.de",
 Rule@@(ToLowerCase@ToString@Head@#&)/@{William&&S,2b||!2b}]



  • Prev by Date: Graphic Module to generate a plot of Goldbach Partition Points for n = 4 up to 200.
  • Next by Date: Re: sort list
  • Previous by thread: Re: sort list
  • Next by thread: Re: sort list