我想使用hdf5storage包在Matlab7.9兼容的文件中保存一个numpy数组,mat_dir是将文件保存到目录中的路径,但是hdf5storage.write()将mat文件写入当前目录。原因何在?
matfile = {}
matfile[u'image'] = myimage
hdf5storage.write(matfile, mat_dir, mat_file_name, matlab_compatible=True)
##mat_dir=/home/user/workspace/img/发布于 2018-06-17 02:35:00
我可以使用另一个函数来解决这个问题:
hdf5storage.savemat(os.path.join(mat_dir, mat_file_name), {'image': myimage}, format='7.3') 并成功保存在给定的目录中。
https://stackoverflow.com/questions/50890329
复制相似问题