[SciPy-dev] Matlab io bug; request for advice

Matthew Brett matthew.brett@gmail....
Fri Feb 20 11:01:14 CST 2009


> Generally, I think it's a very bad choice to use a matlab file to store
> and retrieve numpy arrays, since you loose information about the shape
> of the arrays, in one or the other way. The matlab read/write functions
> in scipy.io are useful to exchange data between numpy and matlab. If I
> save a vector in matlab, isn't it natural to get a 1d array when load it
> with numpy?

You don't lose the shape of matlab arrays when loaded into python.  I
suppose you do lose the distinction between 1D and 2D arrays when
going from numpy -> matlab -> python, but, as matlab can't preserve
this, there's no way round that.



More information about the Scipy-dev mailing list