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

Nils Wagner nwagner@iam.uni-stuttgart...
Thu Mar 22 12:15:43 CDT 2012


On Thu, 22 Mar 2012 15:42:51 +0200
  Jaakko Luttinen <jaakko.luttinen@aalto.fi> wrote:
> 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
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

Hi Jaakko,

works fine for me with python 2.7.2 on opensuse12.1

>>> sp.__version__
'0.11.0.dev-e7d3e33'
>>> np.__version__
'1.7.0.dev-3503c5f'

Cheers,
                         Nils


More information about the SciPy-User mailing list