Extract values (not index) from list between specific bounds

Hi all,

I’ve been scouring this forum for an answer to my question, but I haven’t found an answer yet so I thought I’d post here.

I have a large list of float values from temperature data, between -35 and 35. I would like to extract values within certain buckets and place them in a new list: so all values between -5 and 0 go in a list, between 0-20, between 20-25, etc.

I am not too experienced with gh, but what I’m running into is if I do some kind of domain/subset operation, it operates on indexes, not on values. I have attached a screenshot of what I was working on to extract all values between -35 and 0, but as you can see in the result the values it’s giving back to me are >0. On closer inspection, I realized it must be because it’s operating on the indexes 0>35, not the values.

Any help would be much appreciated.

Here is one idea.


DomainTest.gh (13.2 KB)

1 Like

these could be two ways to do that:

just note that for the second method (consecutive domains) the start/end values of the domain are actually included in the domain itself
so for instance if you test the value “0”, it will be present in both “-5 to 0” and “0 to 20”
ExtractValues.gh (13.1 KB)

1 Like

Thank you so much, works perfectly!

Thank you, great solution as well.