Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
(def a [[1 2 3] [4 5 6] [7 8 9]])
(def b (apply (partial mapv vector) a))
real :: a(n,m), b(m,n)
b = transpose(a)
const a = [[1, 2, 3], [4, 5, 6]]
const m = a[0].length
const b = Array.from({ length: m }, (_, n) => a.map(row => row[n]))
int b[][] = new int[m][n], x, y;
for (y = 0; y < m; ++y)
for (x = 0; x < n; ++x)
b[y][x] = a[x][y];
local a = {}
for x = 1, n do
local t = {}
for y = 1, m do
t[y] = {x, y}
end
a[x] = t
end
local b = {}
for y = 1, m do
local t = {}
for x = 1, n do
t[x] = a[x][y]
end
b[y] = t
end
a = [[1,2], [3,4], [5,6]]
b = list(map(list, zip(*a)))
b = [*zip(*a)]
a = [[1,2], [3,4], [5,6]]
b = a.transpose