Mathematica 9 is now available
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: Sorting question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52767] Re: [mg52758] Sorting question
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 13 Dec 2004 04:22:03 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Union[data, SameTest -> (#1[[2]] <= #2[[2]] &)]


Bob Hanlon

> 
> From: Nimrod <jdedguard-agent at yahoo.co.uk>
To: mathgroup at smc.vnet.net
> Date: 2004/12/11 Sat AM 05:23:38 EST
> To: mathgroup at smc.vnet.net
> Subject: [mg52767] [mg52758] Sorting question
> 
>  A simple sorting question that has me stumped as to how to do it both
> quickly and elegantly.
> 
> I have a list of data pairs of the form (distance, time).  I want to
> sort on the distance element and then remove all pairs where the time
> element is out of order with the distance element.  For example
> ((1,1),(2,3),(3,2),(4,4)) --> ((1,1),(4,4)).  The actual lists are
> much longer.
> 
> Thanks in advnace,
> 
> Nimrod.
> 
> 


  • Prev by Date: rotatelabel in linux
  • Next by Date: Re: Sorting question
  • Previous by thread: Re: Sorting question
  • Next by thread: Re: Sorting question