Forum Discussion
List.Unzip wanted
- 6 years ago
Hi Anonymous
You can zip it again, this will reverse the zip, or am I missing something?
= List.Zip( List.Zip( { { 1, 2 }, { 3, 4 }, { 5, 6 } } ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Hi Anonymous
You can zip it again, this will reverse the zip, or am I missing something?
= List.Zip( List.Zip( { { 1, 2 }, { 3, 4 }, { 5, 6 } } ) )
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
wow. this is the solution :-).
I was speculating on the InsertRanges
function and I was thinking about situations of possible errors to manage.
In particular, I was thinking of cases where the different length of the vectors involved can lead to error.
Aside from these cases, a potential error situation occurred to me which also depends on the order of the elements in the vectors.
And on this I looked for ways to manage the situation.
la situazione si potrebbe presentare quando positions and ranges are, for instance,
{1, 5, 2} and {22,55, {33,44}}.
I tryed to solve in the following way:
let
Source = List.Sort(List.Zip({{1, 5, 2}, {22,55, {33,44}}}),each _{0})
in
List.Accumulate(Source, {{},{}},(s,c)=>{s{0}&{c{0}},s{1}&{c{1}}})
But now there is not needs of news unzip function.
- Anonymous6 years agoNot applicable
...
in some respects the transformation carried out by the list.zip function on a set of lists is analogous (isomorphic?!) to that made by the table.transpose function on the set of columns of a table.
therefore like the transpose (transpose (T)) = T, should be also List.Zip (list.Zip (lists)) = liststhis property indicates yet another way of realizing the list.zip function through other functions
let ListZipUnZip = (lsts) => Table.ToColumns(Table.Transpose(Table.FromColumns(lsts))) in ListZipUnZipof course also the dual situation is valid.
if you wanted, for very personal reasons, to simulate the Table.Transpose function, you could use List.Zip
let transpose = (tab) => Table.FromColumns(List.Zip(Table.ToColumns(tab))) in transpose