Does it do what you want?
julia> a = Array{Float64}[] 0-element Array{Array{Float64,N},1} julia> for i=1:3 push!(a,[1.,2.,3.,4.]) end julia> a 3-element Array{Array{Float64,N},1}: [1.0,2.0,3.0,4.0] [1.0,2.0,3.0,4.0] [1.0,2.0,3.0,4.0] julia> b = hcat(a...)' 3x4 Array{Float64,2}: 1.0 2.0 3.0 4.0 1.0 2.0 3.0 4.0 1.0 2.0 3.0 4.0
It seems to match python output:
In [9]: a = [] In [10]: for i in range(3): a.append([1, 2, 3, 4]) ....: In [11]: b = numpy.array(a); b Out[11]: array([[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]])
I should add that this is probably not what you really want to do, since hcat(a...)' can be expensive if a has many elements. Is there a reason not to use a 2d array from the start? Perhaps there is more context to the question (i.e. the Code you are actually trying to write).