MathGroup Archive 2005

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

Search the Archive

Re: Sort problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56356] Re: [mg56292] Sort problem
  • From: DrBob <drbob at bigfoot.com>
  • Date: Fri, 22 Apr 2005 06:24:08 -0400 (EDT)
  • References: <200504210936.FAA05023@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

age={30,12,60,20};
pple={"john","kate","peter","alice"};
{age,pple}=Transpose@Sort@Transpose@{age,pple}

{{12,20,30,60},{kate,alice,john,peter}}

Bobby

On Thu, 21 Apr 2005 05:36:11 -0400 (EDT), <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
>
>
>
>



-- 
DrBob at bigfoot.com


  • Prev by Date: Re: Sort problem
  • Next by Date: Re: multiple 3d plots
  • Previous by thread: Re: Sort problem
  • Next by thread: Re: Sort problem