Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15850 > unrolled thread

Re: Sorting nested lists with strings

Started byAdriano Pascoletti <adriano.pascoletti@uniud.it>
First post2011-02-10 10:23 +0000
Last post2011-02-10 10:23 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Sorting nested lists with strings Adriano Pascoletti <adriano.pascoletti@uniud.it> - 2011-02-10 10:23 +0000

#15850 — Re: Sorting nested lists with strings

FromAdriano Pascoletti <adriano.pascoletti@uniud.it>
Date2011-02-10 10:23 +0000
SubjectRe: Sorting nested lists with strings
Message-ID<ij0ebj$9fb$1@smc.vnet.net>
Use SortBy[list, f]

In[7]:= list = {{"Paul", 23}, {"Amanda", 55}, {"Carl", 32}}; SortBy[list,
First]
Out[7]= {{"Amanda", 55}, {"Carl", 32}, {"Paul", 23}}


Adriano Pascoletti

2011/2/9 Paperorbifold <kgodelNOSPAM@liberonospam.it>

> I've a nested list of this kind:
> list={{"Paul",23},{"Amanda",55},{"Carl",32},...}
> Suppose I want to perform an alphabetic sort on the first element. Which is
> the condition I've to write in Sort[list,...]?
> Actually Sort[list] automatically operates on the second element.
> Thanks.
>
> --
> ...and I will make them pay for\nwhat they've done! (J.L. Picard)
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web