I am trying to write a dictionary element that is a list of lists of Float64. Here is my MWE:
import NPZ
d = Dict{String, Vector{Vector{Float64}}}("tdnn" => [])
push!(d["tdnn"], [1.,2.,3.])
push!(d["tdnn"], [4.,2.,3.])
NPZ.npzwrite("gordon.npz", d)
NPZ.npzwrite("gordon.npz", d["tdnn"])
I have create a dictionary d
with two Float64
lists of 3 elements each. Here is the error I get when applying npzwrite
. Both statements generate the same error:
ERROR: LoadError: ArgumentError: cannot reinterpret `Vector{Float64}` as `UInt8`, type `Vector{Float64}` is not a bits type
Stacktrace:
[1] throwbits at ./reinterpretarray.jl:16
[2] reinterpret at ./reinterpretarray.jl:41
[3] npzwritearray at /Users/erlebach/.julia/packages/NPZ/UCofn/src/NPZ.jl:360
[4] npzwrite at /Users/erlebach/.julia/packages/NPZ/UCofn/src/NPZ.jl:437
[5] top-level scope at /Users/erlebach/src/2022/rude/giesekus/GE_rude.jl/tst.jl:5
[6] eval at ./boot.jl:368
I do not understand why the need for the reinterpretation. What bit type condition is the error referring to? Must the list of lists be converted to an array before npzwrite
can work properly?
Thanks.