[SciPy-user] scipy.io.savemat works for multi-dim array?

Neal Becker ndbecker2@gmail....
Fri Feb 15 09:59:49 CST 2008


I have a 3-d complex array:

In [63]: data
Out[63]: 
array([[[ 1.13042464+0.28343508j,  1.13035927+0.28343549j,
          1.13029389+0.2834359j , ...,  0.76646124-0.30087241j,
          0.76654565-0.30080131j,  0.76663007-0.3007302j ]]])

I save it like this:

fades = {'data' : data}
from scipy.io import savemat
savemat ('fades.mat', fades)

It seems to have been saved as 1-d:
l = loadmat ('fades.mat')

In [66]: l
Out[66]: 
{'__globals__': [],
 'data': array([ 1.13042464+0.28343508j,  1.13035927+0.28343549j,
        1.13029389+0.2834359j , ...,  0.76646124-0.30087241j,
        0.76654565-0.30080131j,  0.76663007-0.3007302j ])}



More information about the SciPy-user mailing list