Re: Re: Re: Sorting a list of pairs on the second elements
- To: mathgroup at smc.vnet.net
- Subject: [mg51469] Re: [mg51453] Re: Re: Sorting a list of pairs on the second elements
- From: DrBob <drbob at bigfoot.com>
- Date: Tue, 19 Oct 2004 02:55:40 -0400 (EDT)
- References: <cklmi7$f1o$1@smc.vnet.net> <200410150647.CAA05265@smc.vnet.net> <200410160820.EAA23720@smc.vnet.net> <ckt7a7$7as$1@smc.vnet.net> <200410180149.VAA18446@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
>> Both methods do the same thing at my machine,
>
> They should not when the data is actually made of Strings.
I copied from the e-mail, foolishly thinking the list was in usable InputForm.
Bobby
On Sun, 17 Oct 2004 21:49:43 -0400 (EDT), Peltio <peltio at twilight.zone> wrote:
> "DrBob" wrote
>
>> Both methods do the same thing at my machine,
>
> They should not when the data is actually made of Strings.
>
> sss={{"ttcttgcctttgcgg","121"},...}
> and not symbols and integers as in
> sss={{ttcttgcctttgcgg,121},...}
>
>> and there's also a third method that may do better: [snip]
>> Reverse /@ Sort[Reverse /@ sss]
>
> I had already tried that one but it was slower than
>
> Transpose@Reverse@Transpose@Sort@Transpose@Reverse@Transpose[
> sss]
>
> Mapping Reverse on every row of a long list is more time consuming than
> tranposing the matrix and swapping its *two* long rows.
> This is the side effect of working with an interpreted language, I guess.
>
> cheers,
> Peltio
> Invalid address in reply-to. Crafty demunging required to mail me.
>
>
>
>
>
>
>
>
--
DrBob at bigfoot.com
www.eclecticdreams.net
- References:
- Re: Sorting a list of pairs on the second elements
- From: "Peltio" <peltio@twilight.zone>
- Re: Re: Sorting a list of pairs on the second elements
- From: János <janos.lobb@yale.edu>
- Re: Re: Sorting a list of pairs on the second elements
- From: "Peltio" <peltio@twilight.zone>
- Re: Sorting a list of pairs on the second elements