deepdish
deepdish copied to clipboard
Save MATLAB dataset (.mat file) in HDF5 format
Hello,
I have loaded a MATLAB dataset into Python using scipy.io.loadmat(), and have a dictionary saved in a dictionary named mat.
I would like to save this dictionary in HDF5 format, so I can load it into Python when I run the program again. On trying dd.io.save('test.h5', mat), I get the following error:
ValueError: compound data types are not supported: dtype([('ddm', 'O'), ('nfold', 'O'), ('cv_par1', 'O'), ('cv_par2', 'O'), ('cl', 'O')])
Is there any way to fix this, so I can save the MATLAB dataset in HDF5 format?
I'd greatly appreciate any help.
Thank you,
I just stumbled across your question. I don't have a direct answer, but I have a suggestion. I work with Matlab files quite often and I always use the "struct_as_record=False" option in loadmat. That might solve the issue you're having.