I need to track an Array{Int64.2} for each row in my data frame. The dimensions of the array are not standard across the rows. How do I instantiate that column before running through and filling it in later in my code?
Maybe like this?
julia> using DataFrames
julia> df = DataFrame(a = rand(5))
5×1 DataFrame
│ Row │ a │
│ │ Float64 │
├─────┼──────────┤
│ 1 │ 0.106733 │
│ 2 │ 0.275735 │
│ 3 │ 0.867829 │
│ 4 │ 0.60976 │
│ 5 │ 0.65826 │
julia> df[!, :arraycol] .= Ref([0,0]);
julia> df
5×2 DataFrame
│ Row │ a │ arraycol │
│ │ Float64 │ Array… │
├─────┼──────────┼──────────┤
│ 1 │ 0.106733 │ [0, 0] │
│ 2 │ 0.275735 │ [0, 0] │
│ 3 │ 0.867829 │ [0, 0] │
│ 4 │ 0.60976 │ [0, 0] │
│ 5 │ 0.65826 │ [0, 0] │
Like this?
column = Vector{Array{Int64, 2}}(undef, 10)
column[1] = rand(Int, 10, 2)