How can I create a list of nested lists (no coding)?

Hi,

I’m not talking about datatree but lists. I want the following to result in one list containing two lists in one “stream”:

Entwine?

1 Like

Thanks @Rickson but that’s a tree.
I’m looking for result like this:

Far away of a my computer, but maybe „Group“ & „Ungroup“?

Thanks for the suggestion Tim,

apparently it doesn’t work with numbers
image

UPDATE:
now this is getting closer:

UPDATE2:
That however is a bummer:

Metahopper has “wrap” and “unwrap”

Thanks @arch

Still get 6 items instead of two items with 3 items each

image

You have to wrap them first, then merge

image

Still getting a tree at the end not a list of 2 lists
I’m beginning to think this is just not possible. Lists are automatically changed into their item’s type.
This is why I cannot get a list of a single item. I guess this is something @DavidRutten could explain better.

Well, in the stage after the merge, before you unwrapped it you should have 2 datawrappers with 3 items each. You can then work on that data as if it was just two objects, but it’s not really a ‘list’

This is the key here, I need to be able to extract the items from those lists within a list. like so
l = (1,2,3)
l2 = (4,5,6)
L = (l,l2)
f = L[0]
f → (1,2,3)
f[1] → 2

A list of list (of list of list …) isn‘t a nice thing to implement in a strongly type language. I guess this is one of the good reasons using a tree structure instead. At what point do you have a problem, that you need this?

Why is that @TomTom?
What is the problem of it in a strongly typed language?

Since you need to write the type in front of your variable, you would need to write

List<List<List< object >>> tree = new List<List<List< object >>> ();

That’s what I love about Python (and hate about csharp) :slight_smile:

Yeah, this is one example where it is not good to have a strongly typed language. But there are other situations where it is good to have.

But still there’s the Mathnet.numerics library where nested lists is implemented in .net (csharp)

Can you give an example?

You can write everything as array. But the drawback is that you need to know the size before.

object[][][] tree = new object[4][][];
or
object[, ,] tree = new object[3,4,5];

If you know how to navigate inside the csharp api (and code)

Here’s it
https://numerics.mathdotnet.com/

Well I haven’t found an example here, so my assumption was you are misinterpreting matrix and jagged/multidimensional arrays with multidimensional lists.