[SciPy-User] Corrupted data when using io.loadmat with format='5' and an array of strings.

Nicolas Pinto nicolas.pinto@gmail....
Thu Mar 18 22:13:27 CDT 2010


Hello,

Using scipy 0.7.1 I'm getting "corrupted" data when using MATLAB v5
format but not with v4:

In [12]: from scipy import io

In [13]: d = {'str':['test','test2','test34']}

In [14]: io.savemat('bug', d, format='4'); io.loadmat('bug')
Out[14]:
{'__globals__': [],
 'str': array([u'test', u'test2', u'test34'],
      dtype='<U6')}

In [15]: io.savemat('bug', d, format='5'); io.loadmat('bug')
Out[15]:
{'__globals__': [],
 '__header__': 'MATLAB 5.0 MAT-file Platform: posix, Created on: Thu
Jan 14 14:15:11 2010',
 '__version__': '1.0',
 'str': array([u'tttttt', u'e\x00e2e3', u's\x00s\x00s4'],
      dtype='<U6')}


Am I doing something wrong or is this a bug? If so, how can I help fix it ?

Thanks in advance.

Regards,

-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto


More information about the SciPy-User mailing list