I’m manipulating a csv file to add another hierarchy in the tree structure based on rows that share a similar value. I start out with 7264 rows or so with 22 entries per row. {7264} N=22 . Based on unique values in the 0th entry, I want to create another level in the tree structure. So if there are 103 unique values for the 0th entry, I want to divide up those 7264 rows into a 103 branches/groups so that the structure is like {103;x} N=22, where x is the 7264 rows divided across 103 groups.
I thought the way to do it would be to use sets and member index to get the index of all the unique values, and then feed the indices into the tree branch component to alter the structure of the original data. However, there is no actual change to the data once I do this. (this is what I usually do for lists). I’ve googled a lot and tried out a bunch of tree components and I still can’t seem to find out how to do something simple like this… Would appreciate any help!
I have uploaded the csv and the gh file in case anyone wants to take a look.
Thanks for your quick reply! I still want 7k branches, but just divided into those 103 unique values by branching. So 2 is partially what I want, with an addition of another partition list component to get N = 22 like this:
I’ve already gotten the solution, but I didn’t want to flatten the tree- it feels like the wrong thing to do. For the result that I want do you know if there is an easier way to do it? Before seeing your answer I wrote a python script using tree helpers and it was so much simpler but I thought I should learn the grasshopper way of doing it…