| Author |
Comment/Response |
centurion
|
01/25/12 09:28am
Sorting by the second Element (Number): OKAY
Sort[{{"aa", 2}, {"cc", 1}, {"bb", 3}}, #1[[2]] < #2[[2]] &]
{{"cc", 1}, {"aa", 2}, {"bb", 3}}
Sorting by the first Element (String): undefinied ???
In[21]:= Sort[{{"aa", 2}, {"cc", 1}, {"bb", 3}}, #1[[1]] < #2[[1]] &]
Out[21]= {{"aa", 2}, {"cc", 1}, {"bb", 3}}
How can i get the answer:
{{"aa", 2}, {"bb", 3}, {"cc", 1}}
It is for processing a list with address data
thx!
URL: , |
|