MathGroup Archive 2005

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

Search the Archive

Re: Sort problem


On Apr 21, 2005, at 5:36 AM, konstantpi at mail15.com wrote:

> Hi
> How to sort two lists such as:
> age={30,12,60,20};
> pple={"john","kate","peter","alice"};
>
> to give the output:
> age={12,20,30,60}
> pple={"kate","alice","john","peter"}
>
> ie: to keep every person opposite his age number.
> thanks

In[7]:=
Transpose[Sort[Thread[
     {age, pple}]]]
Out[7]=
{{12, 20, 30, 60},
   {"kate", "alice", "john",
    "peter"}}

János


----------------------------------------------
Trying to argue with a politician is like lifting up the head of a  
corpse.
(S. Lem: His Master Voice)


  • Prev by Date: Re: multiple 3d plots
  • Next by Date: Re: removing sublist . Again and Different
  • Previous by thread: Re: Sort problem
  • Next by thread: Re: Sort problem