Hello,
I am new to Grasshoper and have te following problem.
I have a list and want to find the next higher and lower value to a number and extract it to a new list.
Right now I only have a solution for giving me the closest point.
Hello
to find the highest you can
reverse the list and take the first value (i=0)
or put -1 as i, it will gave you the last value
I basically need the neighbouring numbers
What do you mean by reverse the list? Depending on the given number (here 0.25) it doesn´t always give me the lowest number. So in some case I also have the finde the next smaller number to my given number
I think I quite understand, but your first formulation was not clear. Also I think that abs doesn’t help to give for the following needs.
I think you can sort the list of number, find the number that is closest to you number then take index -1 and index +1 to find the neighbors.
To make a list of index use Series
FIND NUMBER.gh (10.3 KB)
Upload your code//
my mystake, its working. thank you!!