Is there any function like numpy.stack(arrays, axis=),I’ve tried repeat(a, inner=()), but this method can’t specify axis, and reshape after repeat doesn’t work.
Here are a few ways to do what you might be asking. Since Julia’s arrays are column-major, it is more common to think of slices as occupying the first dimensions than the last.
julia> as = [rand(Int8, 2) for _ in 1:3]
3-element Array{Array{Int8,1},1}:
[-113, 90]
[-42, 13]
[-25, -74]
julia> reduce(hcat, as)
2×3 Array{Int8,2}:
-113 -42 -25
90 13 -74
julia> [a[i] for i in eachindex(first(as)), a in as]
2×3 Array{Int8,2}:
-113 -42 -25
90 13 -74
julia> LazyStack.stack(as)
2×3 stack(::Array{Array{Int8,1},1}) with eltype Int8:
-113 -42 -25
90 13 -74
julia> JuliennedArrays.Align(as, 1)
2×3 Align{Int8,2,Array{Array{Int8,1},1},Tuple{True,False}}:
-113 -42 -25
90 13 -74