[SciPy-User] Bug in scipy.io.mmread?

Jaakko Luttinen jaakko.luttinen at aalto.fi
Thu Mar 22 09:42:51 EDT 2012


Hi!

I am trying to read the following matrix market file:
ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/lsq/illc1033.mtx.gz

However, it doesn't work with Python 3 and SciPy 0.11.0:

=====================================================
Python 3.2.2 (default, Oct 27 2011, 13:08:00)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.version.version
'0.11.0.dev-Unknown'
>>> from scipy.io import mmread
>>> mmread('illc1033.mtx.gz')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/home/jluttine/.local/lib/python3.2/site-packages/scipy/io/mmio.py",
line 68, in mmread
    return MMFile().read(source)
  File
"/home/jluttine/.local/lib/python3.2/site-packages/scipy/io/mmio.py",
line 302, in read
    return self._parse_body(stream)
  File
"/home/jluttine/.local/lib/python3.2/site-packages/scipy/io/mmio.py",
line 447, in _parse_body
    flat_data = flat_data.reshape(-1,3)
ValueError: total size of new array must be unchanged
=====================================================

It does work with Python 2 and SciPy 0.7.2:

=====================================================
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.version.version
'0.7.2'
>>> from scipy.io import mmread
>>> mmread('illc1033.mtx.gz')
<1033x320 sparse matrix of type '<type 'numpy.float64'>'
	with 4732 stored elements in COOrdinate format>
=====================================================

Is there a bug in recent scipy.io.mmread or what could be the problem?

Best,
Jaakko



More information about the SciPy-User mailing list