![](https://secure.gravatar.com/avatar/d41fa6e1fe29e6c5c5821b5a3f31f190.jpg?s=120&d=mm&r=g)
Hi all, I have some trouble when using mmread; k0.mtx is large and sparse matrix. %%MatrixMarket matrix coordinate real general % Generated 08-Nov-2004 67986 67986 4222171 ... Traceback (most recent call last): File "test1.py", line 4, in ? ma = io.mmread('k0.mtx') File "/usr/lib/python2.3/site-packages/scipy/io/mmio.py", line 208, in mmread a = coo_matrix(data,(row,col),M=rows,N=cols) File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1366, in __init__ self._check() File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1376, in _check self.ftype = _transtabl[self.typecode] KeyError: 'O'
Any pointer would be appreciated. Nils
![](https://secure.gravatar.com/avatar/9b85a909fbfc71a3ea3275c7872e714d.jpg?s=120&d=mm&r=g)
On Mon, 8 Nov 2004, Nils Wagner wrote:
Hi all,
I have some trouble when using mmread; k0.mtx is large and sparse matrix.
%%MatrixMarket matrix coordinate real general % Generated 08-Nov-2004 67986 67986 4222171 ...
Traceback (most recent call last): File "test1.py", line 4, in ? ma = io.mmread('k0.mtx') File "/usr/lib/python2.3/site-packages/scipy/io/mmio.py", line 208, in mmread a = coo_matrix(data,(row,col),M=rows,N=cols) File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1366, in __init__ self._check() File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1376, in _check self.ftype = _transtabl[self.typecode] KeyError: 'O'
Any pointer would be appreciated.
I suspect that k0.mtx contains only integer values (some maybe larger that sys.maxint) and so asarray(data) returns array object with typecode=='O'. Could you send the file k0.mtx to me (don't send large files to the list) and I'll see if I can workaround this problem. Pearu
![](https://secure.gravatar.com/avatar/d41fa6e1fe29e6c5c5821b5a3f31f190.jpg?s=120&d=mm&r=g)
On Mon, 8 Nov 2004 12:07:00 -0600 (CST) Pearu Peterson <pearu@scipy.org> wrote:
On Mon, 8 Nov 2004, Nils Wagner wrote:
Hi all,
I have some trouble when using mmread; k0.mtx is large and sparse matrix.
%%MatrixMarket matrix coordinate real general % Generated 08-Nov-2004 67986 67986 4222171 ...
Traceback (most recent call last): File "test1.py", line 4, in ? ma = io.mmread('k0.mtx') File "/usr/lib/python2.3/site-packages/scipy/io/mmio.py", line 208, in mmread a = coo_matrix(data,(row,col),M=rows,N=cols) File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1366, in __init__ self._check() File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1376, in _check self.ftype = _transtabl[self.typecode] KeyError: 'O'
Any pointer would be appreciated.
I suspect that k0.mtx contains only integer values (some maybe larger that sys.maxint) and so asarray(data) returns array object with typecode=='O'. Could you send the file k0.mtx to me (don't send large files to the list) and I'll see if I can workaround this problem.
Pearu
Pearu, Thank you for your reply. Actually, the file is very large (60 MB). How should I send it to you ? Nils
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user
![](https://secure.gravatar.com/avatar/9b85a909fbfc71a3ea3275c7872e714d.jpg?s=120&d=mm&r=g)
On Mon, 8 Nov 2004, Nils Wagner wrote: <snip>
Any pointer would be appreciated.
I suspect that k0.mtx contains only integer values (some maybe larger that sys.maxint) and so asarray(data) returns array object with typecode=='O'. Could you send the file k0.mtx to me (don't send large files to the list) and I'll see if I can workaround this problem.
Pearu
Pearu,
Thank you for your reply. Actually, the file is very large (60 MB). How should I send it to you ?
If you would gzip it, the size should reduce to 6-10 MB that should be ok for sending it by E-mail (DON'T send it to list). However, if you could just send an url where to download it, that would be perfect. Pearu
![](https://secure.gravatar.com/avatar/9b85a909fbfc71a3ea3275c7872e714d.jpg?s=120&d=mm&r=g)
On Mon, 8 Nov 2004, Pearu Peterson wrote:
On Mon, 8 Nov 2004, Nils Wagner wrote:
Hi all,
I have some trouble when using mmread; k0.mtx is large and sparse matrix.
%%MatrixMarket matrix coordinate real general % Generated 08-Nov-2004 67986 67986 4222171 ...
Traceback (most recent call last): File "test1.py", line 4, in ? ma = io.mmread('k0.mtx') File "/usr/lib/python2.3/site-packages/scipy/io/mmio.py", line 208, in mmread a = coo_matrix(data,(row,col),M=rows,N=cols) File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1366, in __init__ self._check() File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1376, in _check self.ftype = _transtabl[self.typecode] KeyError: 'O'
Any pointer would be appreciated.
I suspect that k0.mtx contains only integer values (some maybe larger that sys.maxint) and so asarray(data) returns array object with typecode=='O'. Could you send the file k0.mtx to me (don't send large files to the list) and I'll see if I can workaround this problem.
Thanks for sending the file. It contains a line 34362 34362 559000591904384 where 559000591904384 in python evaluates to 559000591904384L and asarray returned an array with typecode=='O' as a result. This issue is now fixed in scipy CVS. Pearu
![](https://secure.gravatar.com/avatar/d41fa6e1fe29e6c5c5821b5a3f31f190.jpg?s=120&d=mm&r=g)
Pearu Peterson wrote:
On Mon, 8 Nov 2004, Pearu Peterson wrote:
On Mon, 8 Nov 2004, Nils Wagner wrote:
Hi all,
I have some trouble when using mmread; k0.mtx is large and sparse matrix.
%%MatrixMarket matrix coordinate real general % Generated 08-Nov-2004 67986 67986 4222171 ...
Traceback (most recent call last): File "test1.py", line 4, in ? ma = io.mmread('k0.mtx') File "/usr/lib/python2.3/site-packages/scipy/io/mmio.py", line 208, in mmread a = coo_matrix(data,(row,col),M=rows,N=cols) File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1366, in __init__ self._check() File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1376, in _check self.ftype = _transtabl[self.typecode] KeyError: 'O'
Any pointer would be appreciated.
I suspect that k0.mtx contains only integer values (some maybe larger that sys.maxint) and so asarray(data) returns array object with typecode=='O'. Could you send the file k0.mtx to me (don't send large files to the list) and I'll see if I can workaround this problem.
Thanks for sending the file. It contains a line
34362 34362 559000591904384
where 559000591904384 in python evaluates to 559000591904384L and asarray returned an array with typecode=='O' as a result.
This issue is now fixed in scipy CVS.
Great ! Thank you very much ! BTW, are iterative solvers also affected with respect to this typecode ? Nils
Pearu
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user
participants (2)
-
Nils Wagner
-
Pearu Peterson