Counting the number of branches in a tree branch

Hey everyone

So ive got a data tree in the following structure:

{0;0}
{0;1}

{0;103}
{1;0}
{1;1}

{1;103}
{2;0}
{2;1}

{1132;67}

i would like to find the number of first level branches, which in this case would be 1132. using List Length returns the number of items in the same branch. using List Length after Tree Stats returns the total number of branches. None of these is what I need. How can i do this?

The next step is to find the number of second level branches in each branch (eg, 103 for branch {0})

heres the file with the tree:
tree branch count question.gh (412.5 KB)

thank you so much in advance!

This might help

amazing, thank you!

isn’t it a bit weird that there isn’t a simpler way to do this? i think a branch count block would be really useful

I don’t mind using Tree Statistics but I do think it could have more information, even it was in a list that you had to pick from (like a list of branch amounts for the whole tree.

1 Like