I would like to group my elements in three lists based on whether the distance is within, between or above the two margins given. I have the following code now which works but I don’t really like the boolmask filters and feel like there is a better solution but I haven’t been able to achieve it, also not in python because I am unable to get it to work due to the sublists.
Combine your conditions into nested If statements that return 3 unique values based on the condition they meet. Then use GroupByKey to group the items based on the unique value.
That being said, Python would be way better. Why are the sublists a problem exactly?
Thanks for your input!! Didn’t think about using GroupByKey here.
Regarding the Python: I couldn’t get it to work yesterday, it was late and I was tired, but today with a new, fresh look i’ve got working code !
I’ve done some testing with three methods: 1. List.GroupByKey, 2. List.FilterByBoolMask and 3. Python script. Using the TuneUp method I’ve determined that the Python script is the fastest method.