Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the proper name of a zip-like method that "pivots" a list of lists?

Given a list of lists, such as ((a b c d) (e f g h) (i j k l) (m n o p) (q r s t)), I'd like to write a transformation to a new list of lists consisting of the first item from each list, followed the second item from each list, etc. (in my example, the result of this would be ((a e i m q) (b f j n r) (c g k o s) (d h l p t))).

Does this operation have a distinct name, apart from zip? If so, what is that name?

like image 930
Amanda Mitchell Avatar asked Dec 04 '22 05:12

Amanda Mitchell


1 Answers

The best word for it is probably transpose.

Your list of lists can be thought of as a matrix, and this is a matrix transposition.

like image 143
Don Roby Avatar answered May 25 '23 01:05

Don Roby