[SciPy-user] io.loadmat: TypeError Array can not be safely cast to required type

Yichun Wei yichunwe at usc.edu
Tue Dec 14 16:24:24 CST 2004


Sorry if you received multiple messages about this. I do not know if 
this is a perticular case. I was fine with io.loadmat
about 1 week ago. It persuaded me to make a switch to scipy. However,
when I updated my python to active python 2.3.4, 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
    el, name = _parse_mimatrix(fid,numbytes)
  File "C:\Python23\Lib\site-packages\scipy\io\mio.py", line 510, in
    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

anyone can help me out?

- yichun

More information about the SciPy-user mailing list