Building lists of lists from other lists of lists


#1

That’s a lot of lists in the topic name, but I think that explains it! Here’s what I’m after:

 

Any ideas how one can achieve this without Python? I basically want to lace one sub-list with another sub-list and create nested lists with pairs in each. Any help is greatly appreciated, thanks in advance!


#2

Well, seems like I figured out a way but I’m not sure it’s the most efficient. I resized the short list to match the size of the longer list of lists, then joined and transposed. Just seems harder than it should be!


#3

Maybe:

ListListS

Sorry, the last list must be “flatten (1)”

Thanks for your solution, I learned something new :slight_smile:


#4

This is about matching up Items and Lists.

2015-04-23_2157

 


#5

Ahhh thanks Zac, Grasshopper still learning here :slight_smile:

Thanks for your solution Leo. As they way, more than one way to skin a cat (meowww!).


#6

Here’s Leo’s example with a slight modification and using the same datasets above. I’m still learning how to use nodes as functions, so this was a good example of using List.OfRepeatedItem for that purpose. Zac’s example uses yet another node as a function and is more direct and short.

Leo


#7

Oops, I made a minor change in the end to clean up the graph and didn’t notice I messed out the output. Since this forum doesn’t allow editing after a very short time following the post, I’m reposting the correct image below.

Leo


#8

Sorry to Zombie an “oldish” thread … but I’ve come across a different way of accomplishing it. Not particularly different from Zach’s method, but I don’t need to reverse each sublist at the end.

BuildLists4


#9

Oh cool, thanks for the tip! I like that, but I’m still struggling a little with visualizing the result of combinators & functions. Great to have another example.