MathGroup Archive 2005

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

Search the Archive

Re: Sort problem

  • To: mathgroup at
  • Subject: [mg56323] Re: [mg56292] Sort problem
  • From: "Caffa Vittorio Dr." <Caffa at>
  • Date: Fri, 22 Apr 2005 06:22:49 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Try this:

In[1]:= age = {30, 12, 60, 20};

In[2]:= pple = {"john", "kate", "peter", "alice"};

In[3]:= {age, pple} = Transpose[Sort[Transpose[{age, pple}]]];

In[4]:= age

Out[4]= {12, 20, 30, 60}

In[5]:= pple

Out[5]= {kate, alice, john, peter}

Cheers, Vittorio

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

  • Prev by Date: Re: 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