Here’s a python version that doesn’t necessarily have to use booleans. It just splits a list of items based on groupings of paired values.
You could easily modify it to look specifically for
False
or any other value by changing the query to the target value and removing the output section of the else
statement.
Code
items = IN[0]
vals = IN[1]
out = []
sub = []
items.append(None)
vals.append(None)
prev = vals[0]
for item,val in zip(items,vals):
if val == prev:
sub.append(item)
prev = val
else:
out.append(sub)
sub = []
sub.append(item)
prev = val
OUT = out