MathGroup Archive 2005

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

Search the Archive

Re: Sort problem

  • To: mathgroup at
  • Subject: [mg56333] Re: [mg56292] Sort problem
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Fri, 22 Apr 2005 06:23:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: konstantpi at [mailto:konstantpi at] 
To: mathgroup at
>Sent: Thursday, April 21, 2005 11:36 AM
>Subject: [mg56333] [mg56292] Sort problem
>How to sort two lists such as:
>to give the output:
>ie: to keep every person opposite his age number.

In[7]:= {sage, spple} = 
  With[{ordage = Ordering[age]}, {age[[ordage]], pple[[ordage]]}]
{{12, 20, 30, 60}, {"kate", "alice", "john", "peter"}}

Hartmut Wolf

  • Prev by Date: Re: Adding new rules to Simplify
  • Next by Date: Re: Sort problem
  • Previous by thread: Re: Sort problem
  • Next by thread: Re: Sort problem