JuliaAcademy / DataScience

Data Science in Julia course for JuliaAcademy.com, taught by Huda Nassar
https://juliaacademy.com/p/julia-for-data-science
MIT License
488 stars 256 forks source link

06: ArgumentError: All column names must be either Symbols or strings (mixing is not allowed) #23

Closed arisliang closed 3 years ago

arisliang commented 3 years ago

In Method 6 predictions_NN = map(i->parse(Int,string(argmax(DataFrame(possible_labels[i])[1,:]))),1:size(c,2)) gives error:

ArgumentError: All column names must be either Symbols or strings (mixing is not allowed) Stacktrace: [1] DataFrame(::Accumulator{Int64,Int64}; copycols::Bool) at C:\Users\ly.julia\packages\DataFrames\Zx5mm\src\dataframe\dataframe.jl:252 [2] DataFrame(::Accumulator{Int64,Int64}) at C:\Users\ly.julia\packages\DataFrames\Zx5mm\src\dataframe\dataframe.jl:247

[4] iterate at .\generator.jl:47 [inlined] [5] _collect(::UnitRange{Int64}, ::Base.Generator{UnitRange{Int64},var"#23#24"}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at .\array.jl:699 [6] collect_similar(::UnitRange{Int64}, ::Base.Generator{UnitRange{Int64},var"#23#24"}) at .\array.jl:628 [7] map(::Function, ::UnitRange{Int64}) at .\abstractarray.jl:2162

[9] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1091

axsano commented 3 years ago

I think the problem is when it tries to create a column name with an integer value, such as:

DataFrame(Accumulator(1 => 5))

I tested the 1.5.4 version, and it didn't work too.

logankilpatrick commented 3 years ago

Just updated the notebook, this should be resolved!