Consider the following vector:
v = [
(1, [[11, 11, 11], [12, 12, 12]]),
(2, [[21, 21, 21]),
(3, [[31, 31, 31], [32, 32, 32]]),
(4, [[41, 41, 41]),
]
I want to get
4-element Vector{Any}:
[[11, 11, 11], [21, 21, 21], [31, 31, 31], [41, 41, 41]]
[[11, 11, 11], [21, 21, 21], [32, 32, 32], [41, 41, 41]]
[[12, 12, 12], [21, 21, 21], [31, 31, 31], [41, 41, 41]]
[[12, 12, 12], [21, 21, 21], [32, 32, 32], [41, 41, 41]]
When all row of the vector v have same length, there is a code from @rafael.guerra .
re = Vector{Vector{Int64}}[]
n = length(v[1][2])
for i in 1:n, k in 1:n
res = Vector{Int64}[]
push!(res, copy(v[1][2][k]))
for j in 2:length(v)
push!(res, copy(v[j][2][i]))
end
push!(re, res)
end