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

Nils Wagner nils106 at googlemail.com
Thu Jun 6 09:15:59 EDT 2013


Please, can you provide the first three lines of your *.mtx file ?

Nils



On Thu, Jun 6, 2013 at 3:05 PM, Valène Pellissier <
Valene.Pellissier at cedrat.com> wrote:

>  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****
>
> ** **
>
> *****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 at cedrat.com - www.cedrat.com [image: youtube]<http://www.youtube.com/user/CEDRATSOFTWARE><http://www.linkedin.com/company/cedrat?trk=tabs_biz_home>[image:
> youtube] <http://www.facebook.com/pages/CEDRAT/174895345915549?sk=wall>***
> *
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20130606/7d36c3bd/attachment.html>


More information about the SciPy-User mailing list