# Understanding LoadError: ArgumentError in Tables.jl interface

**URL:** <https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159>\
**Category:** General Usage\
**Tags:** question, dataframes\
**Created:** [December 29, 2023, 2:03pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159 "2023-12-29T14:03:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WekawTirso](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@WekawTirso](https://discourse.julialang.org/u/WekawTirso)\
**Post date:** [December 29, 2023, 2:03pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159/1 "2023-12-29T14:03:17Z")

</div>

I am trying to create and save simple array using either of the two methods:

```julia
using CSV, DataFrames

#Attempt 1
let 
    N = 20
    My_Array = []
    i = 0
    for b=2:N-1
        i += 1
        summation = 0.0
        for n=1:5
            summation -= n^2 * log(2*n)
        end
        push!(My_Array, summation)
    end
    fileOut = "output_array.csv"
    CSV.write(fileOut, DataFrame(My_Array), header = false)
end 

#Attempt 2
let 
    N = 20
    My_Array = Array{Float64}(undef, N)
    i = 0
    for b=2:N-1
        i += 1
        summation = 0.0
        for n=1:5
            summation -= n^2 * log(2*n)
        end
        My_Array[i] = summation
    end
    fileOut = "output_array.csv"
    CSV.write(fileOut, DataFrame(My_Array), header = false)
end 

```

I am struggling to find the reason for and the meaning to the following error message:

> ERROR: LoadError: ArgumentError: ‘Vector{Any}’ iterates ‘Float64’ values, which doesn’t satisfy the Tables.jl `AbstractRow` interface

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [December 29, 2023, 2:26pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159/2 "2023-12-29T14:26:26Z")

</div>

`My_Array` in your example is a `Vector`, `DataFrame(...)` doesn’t want `Vector`s. It wants something either (1) Table-like or (2) keyword arguments. Try

```julia
DataFrame(x = My_Array)

```

instead.

---

<div class="post-metadata">

**Author:** ![WekawTirso](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@WekawTirso](https://discourse.julialang.org/u/WekawTirso)\
**Post date:** [December 29, 2023, 3:10pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159/3 "2023-12-29T15:10:56Z")

</div>

Thanks!  
The natural followups are  
(i) Does the same fix work if `My_Array` is `NxN`, `NxNxN`, etc? For instance, I’ve tried to save an `NxN` array get the message

> LoadError: ArgumentError: adding AbstractArray other than AbstractVector as a column of a data frame is not allowed

Is this the same kind of error?  
(ii) Is there a site where I can learn about documentation in an efficient way? I’m thinking of Wolfram Mathematica and how it has the format of a given function along with examples.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [December 29, 2023, 3:43pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159/4 "2023-12-29T15:43:15Z")

</div>

It is documented here [Types · DataFrames.jl](https://dataframes.juliadata.org/stable/lib/types/#DataFrames.DataFrame)

---

<div class="post-metadata">

**Author:** ![WekawTirso](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@WekawTirso](https://discourse.julialang.org/u/WekawTirso)\
**Post date:** [December 29, 2023, 3:56pm UTC](https://discourse.julialang.org/t/understanding-loaderror-argumenterror-in-tables-jl-interface/108159/5 "2023-12-29T15:56:55Z")

</div>

Thank you!
