Imagine the following arrays:
list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
list3 = [9, 10, 11, 12]
list4 = [13, 14, 15, 16]
I want to combine the arrays so that it looks like:
[[1, 5, 9, 13], [2, 6, 10, 14], [3, 7, 11, 15], [4, 8, 12, 16]]
Is there a quick way of turning an arbitrary amount of arrays and arbitrary amount of elements within the arrays into an array of array format? Furthermore, imagine that list1, 2, 3, and 4 are not connected in any way so I cannot just loop through like:
for list in lists:
> finalArray.append(list[n])
I feel like this is some matrix manipulation but I have not worked with matrices very much. Can someone point me in a direction?