ArgumentError y = [y;df[:,Symbol(v)]]

y = Array{Float64,1}()
print(mme.depVarVec)
for v in mme.depVarVec
y = [y;df[:,Symbol(v)]]
end
output:
AbstractString[“y1”, “y2”]
ArgumentError: column name :y1 not found in the data frame; existing most similar names are: :y

Stacktrace:
[1] lookupname at C:\Users\wangzhihua.julia\packages\DataFrames\S3ZFo\src\other\index.jl:253 [inlined]
[2] getindex at C:\Users\wangzhihua.julia\packages\DataFrames\S3ZFo\src\other\index.jl:259 [inlined]
[3] getindex(::DataFrame, ::Colon, ::Symbol) at C:\Users\wangzhihua.julia\packages\DataFrames\S3ZFo\src\dataframe\dataframe.jl:346
[4] top-level scope at .\In[84]:22
Why? Thank you.

Please, follow our best practices when asking for help.

The error seems to be self-explanatory, you are trying to access a column named :y1 in a dataframe, but it does not have a column with such name, the column with the most similar name is :y. Should your dataframe have a column named :y1? It is impossible to me to say without a Minimal Working Example (MWE). Also, are you trying to get a vector or a single value from the dataframe? (the syntax [a; b] allows a and b be either elements or vectors).

2 Likes