Hi,
I am trying to create a nested dictionary where integer tuple keys map to another dictionary with an integer key and a float value. When I try to add values to this data structure, I get a key error
Test = Dict{Tuple{Int64,Int64},Dict{Int64,Float64}}()
Test[(1,1)][1] = 1.0
Stacktrace:
[1] getindex(::Dict{Tuple{Int64,Int64},Dict{Int64,Float64}}, ::Tuple{Int64,Int64}) at .\dict.jl:477
[2] top-level scope at In[89]:3
If I create the data structure manually like so
Test2 = Dict( (1,1) => Dict(1 => 1.0))
I get the data structure I tried to create above
Dict{Tuple{Int64,Int64},Dict{Int64,Float64}} with 1 entry:
(1, 1) => Dict(1=>1.0)
and you can retrieve the value like I tried to add a value initially
Test2[(1,1)][1]
1.0
If I try to add another value though, I get an error.
Test2[(1,2)][2] = 2.0
KeyError: key (1, 2) not found
Stacktrace:
[1] getindex(::Dict{Tuple{Int64,Int64},Dict{Int64,Float64}}, ::Tuple{Int64,Int64}) at .\dict.jl:477
[2] top-level scope at In[93]:1
Any help or guidance would be appreciated.