Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*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 2000

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

Search the Archive

Sort List of Lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24809] Sort List of Lists
  • From: "dana2" <dan_news at hotmail.com>
  • Date: Sun, 13 Aug 2000 03:16:47 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello.  Could someone please give me a clue on how to sort a list based on
the Second Element in a List:
I think one needs to use a "pure function" but I am too new with Mathematica (v4)
(Trying to learn though) :>)

For Example, I would like to sort this list based on the second element in
each sub-list in "Descending" order:

{{9, 2}, {1, 6}, {2, 4}}

Results would be:
{ {1,6},{2,4},{9,2} }


I think I will learn a lot about Lists, Sorting, and Pure Functions all in
one shot  if I could get a hint on how to do this.
Thank you  very much.  Dana






  • Prev by Date: Re: log scale
  • Next by Date: Plotting Solid of Revolution
  • Previous by thread: RE: Please help: display graph G=<V,E>
  • Next by thread: Re: Sort List of Lists