How to access columns in a Vector{Array{Float64,2}}

I have a Vector{Array{Float64,2}} that I want to access columns from, but I don’t know how. It is generated via comprehension. Does it need to be turned into a DataFrame? If so, how? When I try df1 = DataFrames(one_foodweb_result) I get MethodError: objects of type Module are not callable.

I understand that it’s 3D, so to access data is it like [row, column, frame/array]?

Vector{Array{Float64,2}} with 4 elements
50001×6 Array{Float64,2}:
50001×6 Array{Float64,2}:
50001×6 Array{Float64,2}:
50001×6 Array{Float64,2}:

You apparently have a vector of matrices (call it A). A[i] gives you the matrix at position i. A[i][j, k] gives you the entry [j, k] of the matrix at position i in A. A[i][:, k] gives you the column k of the matrix at A[i]. Etc.

3 Likes

Yes! Thank you!