Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15852
| From | Paperorbifold <kgodelNOSPAM@liberoNOSPAM.it> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Sorting nested lists with strings |
| Date | 2011-02-11 09:12 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ij2uhh$7fd$1@smc.vnet.net> (permalink) |
| References | <iitejq$jib$1@smc.vnet.net> <ij0e47$998$1@smc.vnet.net> |
Sjoerd C. de Vries wrote:
> I'm not sure why you think Sort sorts on the second field of the list.
> It doesn't:
>
> In[534]:= list = {{"Paul", 23}, {"Amanda", 5}, {"Carl", 32}};
>
> In[535]:= Sort[list]
>
> Out[535]= {{"Amanda", 5}, {"Carl", 32}, {"Paul", 23}}
Of course you're right! Maybe I was really tired when I sent the message.
It's clear that the option that works immediately is Sort@list (and the
equivalent Sort[list]).
Thanks to everybody for all the answers.
--
...and I will make them pay for what they've done! (J.L. Picard)
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Sorting nested lists with strings "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-02-10 10:19 +0000 Re: Sorting nested lists with strings Paperorbifold <kgodelNOSPAM@liberoNOSPAM.it> - 2011-02-11 09:12 +0000
csiph-web