Hi there - I’m hoping to get some help on a script that’s been causing me issues. I’ve been trying to group a list of values into 20 or so groups based on a range of values for each group. For example, let’s say I have a list of values 1-100 and I am assigning each to one of 5 groups. Each group is equally spaced along the interval of discrete values so for this example, if I have 5 groups for numbers 1-100, each group would be an interval of 20 (1-20, 21-40, 41-60, etc.). For each discrete value I’m investigating, I want to return the group it belongs to so if the number is 45, I want to return 3. For some reason, I’m getting a weird nested list when I return. Can anyone help out with this? I’m still pretty new to grasshopper so any help would be appreciated!

I’ve attached some images showing the input and output as well as the python script.