[SciPy-User] Read matrix from matrix market format file

Valène Pellissier Valene.Pellissier@cedrat....
Thu Jun 6 08:05:47 CDT 2013


Hi,

I've got some problems reading a matrix  from a matrix market format file.
I have Python 3.2 and installed Numpy 1.7.1, Scipy 0.12.0 and matplotlib 1.2.1 on Windows 64.
I tried the scipy.io.mmread function but got an error I don't understand.

>>> B=scipy.io.mmread("my_matrix.mtx")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python32\lib\site-packages\scipy\io\mmio.py", line 70, in mmread
    return MMFile().read(source)
  File "C:\Python32\lib\site-packages\scipy\io\mmio.py", line 301, in read
    self._parse_header(stream)
  File "C:\Python32\lib\site-packages\scipy\io\mmio.py", line 337, in _parse_he
der
    self.__class__.info(stream)
  File "C:\Python32\lib\site-packages\scipy\io\mmio.py", line 208, in info
    raise ValueError("Header line not of length 3: " + line)

It is a big matrix.
Is there someone who has a clue about what I'm doing wrong ?

Your help will be much appreciated.
Thanks
Valene

[cid:image001.jpg@01CE62C7.51BB5AD0]Valène PELLISSIER - R&D Engineer
CEDRAT S.A.
15 Chemin de Malacher - Inovallée - 38246 MEYLAN cedex - FRANCE
Phone: +33 (0)4 76 90 50 45 - Fax: +33 (0)4 56 38 08 30
valene.pellissier@cedrat.com<mailto:valene.pellissier@cedrat.com> - www.cedrat.com<http://www.cedrat.com> [youtube] <http://www.youtube.com/user/CEDRATSOFTWARE> <http://www.linkedin.com/company/cedrat?trk=tabs_biz_home> [youtube] <http://www.facebook.com/pages/CEDRAT/174895345915549?sk=wall>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20130606/bb69440a/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1014 bytes
Desc: image002.png
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20130606/bb69440a/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1130 bytes
Desc: image003.png
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20130606/bb69440a/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 4777 bytes
Desc: image001.jpg
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20130606/bb69440a/attachment-0001.jpg 


More information about the SciPy-User mailing list