[SciPy-user] mat file problem in linux

Fernando Perez Fernando.Perez at colorado.edu
Fri Oct 14 11:54:47 CDT 2005

Ryan Krauss wrote:
> I have a *.mat file created by Matlab in Windows.  Scipy in windows
> can open this file without a problem.  I am now trying to run the same
> code in linux and I get this error:
> /home/ryan/datafit/bodetest.py
>      12 #load matlab data
>      13 #bob=scipy.io.read_array('iobodetest.txt')
> ---> 14 modeldict=scipy.io.loadmat('tmm_mat_model_params.mat')
>      15 bodedict=scipy.io.loadmat('bodetest.mat')
>      16 freq=bodedict['freq']


> TypeError: sequence item 0: expected string, array (scipy) found
> WARNING: Failure executing file: <bodetest.py>
> In [4]: scipy.__version__
> Out[4]: '0.3.2'

Whatever it was, it's been fixed in the last CVS before the SVN transition:

In [2]: import scipy
numerix Numeric 23.7

In [3]: modeldict=scipy.io.loadmat('tmm_mat_model_params.mat')

In [4]: scipy.__version__
Out[4]: '0.3.3_309.4624'

You can either update to that code base, for which I'm keeping this tarball 
available until we've fully moved over to newscipy/core:


or try to directly update to newscipy/core, since the new codebase obviously 
has all the fixes up to that date (but may still be too alpha for your needs).



More information about the SciPy-user mailing list