deepdish icon indicating copy to clipboard operation
deepdish copied to clipboard

Save MATLAB dataset (.mat file) in HDF5 format

Open sophia-wright-blue opened this issue 6 years ago • 1 comments

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,

sophia-wright-blue avatar Mar 08 '18 00:03 sophia-wright-blue

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.

twmacro avatar May 18 '18 15:05 twmacro