Delete all branches with only 0 values

Hey, everyone!

I am trying to find a easy work around for this issue: Basically I would like to clean my list if all itens in the branch are = 0 . I need to evalute my list to check if all itens in the branch have a true value (checking for x ==0) and, if so, delete that specific branch.

I believe I would have to generate a true and false mask for my list and then filter my @L3 of the input but I am struggling to think how to create and efficient way to create the true and false values to input in my mask node. Any ideas on how to do that? Design Script loops to read through the list would be the easiest way?

img sample:

Thanks so much.

Hi,

I would just add an List.AllTrue node @L2 and that should enable you to use the Filterbyboolmask after.

Hope this helps.

1 Like

That was quick. Didn’t know about this node! Perfect Josip.

Thanks so much, saved me plenty of time!

1 Like