a = np.array([[1,2], [3,4], [5,6]])
b = a.T
a = [[1,2], [3,4], [5,6]]
b = list(map(list, zip(*a)))
(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]))
Class<?> c = a.getClass().getComponentType()
.getComponentType();
T b[][] = (T[][]) newInstance(c, m, n);
int y, x;
for (y = 0; y < m; ++y)
for (x = 0; x < n; ++x)
b[y][x] = a[x][y];
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
var
A: array[1..m, 1..n] of ArbFloat;
B: array[1..n, 1..m] of ArbFloat;
begin
... some code to fill A
omvtrm(
A[1,1], m, n, n,
B[1,1], m
);
end.
my ($m, $n) = (3, 2);
my $A = sequence $m, $n;
my $B = transpose $A;
a = [[1,2], [3,4], [5,6]]
b = a.transpose
let a = DMatrix::<u8>::from_fn(n, m, |_, _| rand::thread_rng().gen());
let b = a.transpose();