Re: How to index list with a nested listI think you could do it with substitute
Names Default To Here(1);
l = {"A", "B", "C"};
combinations = As List(N Choose K Matrix(N Items(l), 2));
a = Substitute(combinations, 1 ,"A", 2, "B", 3, "C");
but looping is more clear in my opinion
Re: How to index list with a nested listYeah, the list is not known at the compile time, so I guess I'll have to do it through loops.
Re: How to index list with a nested listI think something like this should work with Transform Each
l1 = Transform Each({idx}, combinations, l[idx]);Re: How to index list with a nested listThis is technically a loop but will also work (assuming you've got lis = the list of values and combinations = the nchoosek matrix of pairs)
i = 1;
res = Repeat( { lis[ combinations[ i++, 0 ] ] } , N Items( lis ) );
How to index list with a nested listBased on https://community.jmp.com/t5/Discussions/Combinations-of-a-list-put-into-columns/m-p/555454
I have a list
list = {"A", "B", "C"}I need based on that make a list of all pair combinations.
Link above helped me to get away from long cycles or joining tables into essentially a one-liner thanks to @brady_brady
I have this so far:
list = {"A", "B", "C"};
combinations = As List(N Choose K Matrix(N Items(list), 2));What it does it gives me a list of lists of INDICES
{{1, 2}, {1, 3}, {2, 3}}and what I need is list of pairs of strings:
{{"A", "B"},{"A", "C"},{"B", "C"}}without going into cycles is there another one-liner that would do that?
Just indexing list with combinations gives me a flat list
list[combinations]
{"A", "B", "A", "C", "B", "C"}
Advanced Statistical ModelingData Blending and CleanupDesign of ExperimentsMass CustomizationQuality and Process Engineering