You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I am using Julia's wonderful HDF5 library. I have come across a kind of strange issue: it seems possible to overwrite vectors, but not scalars. There are some workarounds, like using mid-level routines such as o_delete, or just creating a vector to begin with, but I'm still a bit surprised by this behavior. I am wondering if anyone has any insight to share into this? My apologies if the answer is obvious; I am trained in statistics rather than CS, but my attempts to find a solution in the docs and newsgroups have not been successful so far.
create a vector and a scalar
a=[1,2]
b=1
save using julia's hdf5 library
using HDF5
filepath="~/test.h5"
h5open(filepath, "w") do fid
fid["a"] =a
fid["b"]=b
end
I think this is the nature of the HDF5 library, not of the Julia wrapper. Try the same in Python (I think h5py is supported by the HDF5 group directly). I think the only way to make this work would be to delete f["b"] then create a new f["b"].
Hi everyone, I am using Julia's wonderful HDF5 library. I have come across a kind of strange issue: it seems possible to overwrite vectors, but not scalars. There are some workarounds, like using mid-level routines such as o_delete, or just creating a vector to begin with, but I'm still a bit surprised by this behavior. I am wondering if anyone has any insight to share into this? My apologies if the answer is obvious; I am trained in statistics rather than CS, but my attempts to find a solution in the docs and newsgroups have not been successful so far.
create a vector and a scalar
a=[1,2]
b=1
save using julia's hdf5 library
using HDF5
filepath="~/test.h5"
h5open(filepath, "w") do fid
fid["a"] =a
fid["b"]=b
end
try to rewrite using HDF structure directly
f=h5open(filepath,"r+")
names(f)
f["a"][:]=[1,3] #works
f["b"]=1 #fails
f["b"][:]=1 #fails
f["b"][1]=1 #fails
close(f)
The text was updated successfully, but these errors were encountered: