What is the correct way to save and retrieve dictionaries in Julia?
You could use the JLD
(Julia Data) submodule included in the HDF5
package:
Pkg.add("HDF5")
using HDF5, JLD
d = Dict(
("a", "b") => [1, 2, 3],
("c", "d") => [4, 5, 6],
("e", "f") => [7, 8, 9]
)
save("data.jld", "data", d)
load("data.jld")["data"]
the advantage of the JLD module is that it preserves the exact type information of each variable.