# Create a new DataFrame Column that is of Type Array{Int64,2}

**URL:** https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850
**Category:** General Usage
**Tags:** array, type, dataframes
**Created:** [May 6, 2020, 12:34am UTC](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850 "2020-05-06T00:34:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Phillip\_Sutton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phillip_sutton/32/7603_2.png) [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)
#### Post date: [May 6, 2020, 12:34am UTC](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850/1 "2020-05-06T00:34:30Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [May 6, 2020, 7:05am UTC](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850/2 "2020-05-06T07:05:04Z")

</div>

Maybe like this?

```julia
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] │

```

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [May 6, 2020, 7:05am UTC](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850/3 "2020-05-06T07:05:05Z")

</div>

Like this?

```julia
column = Vector{Array{Int64, 2}}(undef, 10)
column[1] = rand(Int, 10, 2)

```
