[SciPy-user] io.loadmat: broken?

Yichun Wei yichunwe at usc.edu
Fri Jan 7 16:11:28 EST 2005


Hi,

Sorry if you received multiple messages about this. I posted this last 
month for help.

I was fine with io.loadmat about 1 month ago. It persuaded me to make a 
switch to scipy. However, when I updated my python to python 2.3.4, 
scipy to 0.3.2, the following happened:

>>> import scipy.io
>>> scipy.io.loadmat("test")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python23\Lib\site-packages\scipy\io\mio.py", line 692, in loadmat
    thisdict = _loadv5(fid,basename)
  File "C:\Python23\Lib\site-packages\scipy\io\mio.py", line 631, in _loadv5
    el, varname = _get_element(fid)
  File "C:\Python23\Lib\site-packages\scipy\io\mio.py", line 619, in
_get_element
    el, name = _parse_mimatrix(fid,numbytes)
  File "C:\Python23\Lib\site-packages\scipy\io\mio.py", line 510, in
_parse_mimatrix
    result = squeeze(transpose(reshape(result,dims[::-1])))
TypeError: Array can not be safely cast to required type

Scipy 0.3.2_266.4242
Numeric tried with 23.5 and 23.6, with the same problem
Python 2.3.4 and 2.3.2 from activepython

This file can be loaded using Enthought version python which is 2.3.3 
and scipy 0.3. I am wondering whether io.loadmat is broken in the new 
version of scipy, or is there anything wrong I did with io.loadmat.

Thanks for any hint...

- yichun








More information about the SciPy-User mailing list