I’m struggling with one section in a script, pretty sure it has to do with levels/lacing but I’ve played around with that a bit and haven’t reached the intended output yet…
The goal is to to take a list of numbers and find where each number falls within a list of ranges and then associate a percentage to it based on where it is in the range. I have a range of 0-1000, which is then chopped into 11 sublists (0-90, 91-181, etc). These ranges correspond to another list of 11, the percentages (100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0).
Then I have the list that I need to find what range they fall within, which is 7 items right now (but could be more or less depending on the results of the previous section of the graph). This list is 2, 33, 81, 81, 152, 258, 22.
So the expected output at the end of associating percentages would be a list reading 100, 100, 100, 100, 90, 80, 100.
I’m able to get the correct answer when I try just one from the list, but haven’t been able to work out doing the whole list at once. Figuring my problem lies in the list.contains and list.indexof nodes but every way I’ve tried changing the lacing and levels hasn’t produced what I want
“new user” so i can’t upload the script