[SciPy-User] Using scipy.io.loadmat to read Matlab containers.Map object?
Gerrit Holl
gerrit.holl at ltu.se
Mon May 14 10:51:54 EDT 2012
Hi,
is it possible to use scipy.io.loadmat to read a Matlab containers.Map object?
>> cm = containers.Map();
>> cm('abc') = 42;
>> save('/tmp/test.mat', 'cm');
In [15]: M = scipy.io.loadmat('/tmp/test.mat')
In [16]: M.keys()
Out[16]: ['__function_workspace__', 'None', '__version__',
'__header__', '__globals__']
In [17]: M["None"]
Out[17]:
MatlabOpaque([ ('cm', 'MCOS', 'containers.Map', [[3707764736L], [2L],
[1L], [1L], [1L], [1L]])],
dtype=[('s0', '|O8'), ('s1', '|O8'), ('s2', '|O8'), ('arr', '|O8')])
In [15]: M = scipy.io.loadmat('/tmp/test.mat')
In [16]: M.keys()
Out[16]: ['__function_workspace__', 'None', '__version__',
'__header__', '__globals__']
In [17]: M["None"]
Out[17]:
MatlabOpaque([ ('cm', 'MCOS', 'containers.Map', [[3707764736L], [2L],
[1L], [1L], [1L], [1L]])],
dtype=[('s0', '|O8'), ('s1', '|O8'), ('s2', '|O8'), ('arr', '|O8')])
regards,
Gerrit.
--
Gerrit Holl
PhD student at Division of Space Technology, Luleå University of
Technology, Kiruna, Sweden
http://www.sat.ltu.se/members/gerrit/
More information about the SciPy-User
mailing list