Hi all,
I am using scipy.io for switching from python to matlab.
here is my list of list in python
code = [[[1, 2], [3,4], [5, 6]], [[7, 8], [9, 10]]]. I want to convert this to matlab format.
For that I used a code
scipy.io.savemat('/tmp/out.mat', mdict={'Num': (code[0], code[1])}) but it is showing an error message.
tmp/<ipython console> in <module>()
/usr/lib/python2.5/site-packages/scipy/io/mio.py in savemat(file_name, mdict, appendmat)
123
124 MW = MatFile4Writer(file_stream)
--> 125 MW.put_variables(mdict)
126 if file_is_string:
127 file_stream.close()
/usr/lib/python2.5/site-packages/scipy/io/mio4.py in put_variables(self, mdict)
336 class MatFile4Writer(MatFileWriter):
337
338 def put_variables(self, mdict):
339 for name, var in mdict.items():
--> 340 matrix_writer_factory(self.file_stream, var, name).write()
/usr/lib/python2.5/site-packages/scipy/io/mio4.py in matrix_writer_factory(stream, arr, name)
322 if scipy.sparse.issparse(arr):
323 return Mat4SparseWriter(stream, arr, name)
--> 324 arr = N.array(arr)
325 dtt = arr.dtype.type
326 if dtt is N.object_:
<type 'exceptions.ValueError'>: setting an array element with a sequence.
It will be great if anyone can suggest an idea.
many thanks in advance
Vipin T S