Dict() how to creat in 5.0 ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Dict() how to creat in 5.0 ?

programistawpf
Dict() how to creat in 5.0 ?

julia> typeof(slow)
Array{Any,2}

julia> D=Dict(slow[:,1],slow[:,2])
ERROR: MethodError: no method matching Dict{K,V}(::Array{Any,1}, ::Array{Any,1})
Closest candidates are:
  Dict{K,V}(::Any) at dict.jl:383
  Dict{K,V}{T}(::Any) at sysimg.jl:53

It is working code from 4.0
Paul

Reply | Threaded
Open this post in threaded view
|

Re: Dict() how to creat in 5.0 ?

Cedric St-Jean-2
Dict(zip(slow[:,1], slow[:,2])) ?

On Sunday, October 30, 2016 at 8:34:29 AM UTC-4, [hidden email] wrote:
Dict() how to creat in 5.0 ?

julia> typeof(slow)
Array{Any,2}

julia> D=Dict(slow[:,1],slow[:,2])
ERROR: MethodError: no method matching Dict{K,V}(::Array{Any,1}, ::Array{Any,1})
Closest candidates are:
  Dict{K,V}(::Any) at dict.jl:383
  Dict{K,V}{T}(::Any) at sysimg.jl:53

It is working code from 4.0
Paul

Reply | Threaded
Open this post in threaded view
|

Re: Dict() how to creat in 5.0 ?

programistawpf
Yes, thx.
P.
W dniu 2016-10-30 14:14, Cedric St-Jean pisze:
Dict(zip(slow[:,1], slow[:,2])) ?

On Sunday, October 30, 2016 at 8:34:29 AM UTC-4, [hidden email] wrote:
Dict() how to creat in 5.0 ?

julia> typeof(slow)
Array{Any,2}

julia> D=Dict(slow[:,1],slow[:,2])
ERROR: MethodError: no method matching Dict{K,V}(::Array{Any,1}, ::Array{Any,1})
Closest candidates are:
  Dict{K,V}(::Any) at dict.jl:383
  Dict{K,V}{T}(::Any) at sysimg.jl:53

It is working code from 4.0
Paul