Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save MATLAB dataset (.mat file) in HDF5 format #32

Open
sophia-wright-blue opened this issue Mar 8, 2018 · 1 comment
Open

Save MATLAB dataset (.mat file) in HDF5 format #32

sophia-wright-blue opened this issue Mar 8, 2018 · 1 comment

Comments

@sophia-wright-blue
Copy link

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,

@twmacro
Copy link
Contributor

twmacro commented May 18, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants