| Author |
Comment/Response |
prettyperla
|
09/22/11 3:14pm
perlalist = {{{5, 1, "a"}, {6, 2, "b"}, {9, 3, "c"}}, {{10, 1, "a"}, {15, 2,
"b"}, {10, 3, "c"}, {10, 4, "d"}}, {{100, 1, "d"}, {200, 2, "g"}, {300,
4, "t"}}};
I am trying to write code, that compares all the first positions and displays if the first position is x amount or more above all the rest. for this example, lets use x=5. Fyi, I will be using numbers like .00001, .0001, .001, .01 in my real code. if you look at the first part of the list, 9 is the highest, which is not 5 higher than all the rest, so nothing is displayed. In the second part of the list, 15 is 5 higher than all the rest of the first positions, so it is displayed. In the third part, 300 is more than 5 higher than all the rest of the first positions, so it is also displayed.
fyi, this is just a small example of length 2. the real perla list could have a length of 10,000 and use more or less alphabet symbols
output= {{15,2,"b"},{300,4,"t"}}
Thanks in advance
Attachment: experiments.nb, URL: , |
|