[SciPy-dev] Sparse matrices and different types

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Feb 16 08:08:21 CST 2006

I am confused by various types

fname = 'cavity01.mtx.gz'
A = io.mmread(gzip.open(fname))

>>> A
<317x317 sparse matrix of type '<type 'float64scalar'>'
        with 7280 stored elements (space for 7327)
        in Compressed Sparse Row format>
>>> type(A)
<type 'instance'>

VT <type 'instance'>
Vi <type 'numpy.ndarray'>
Traceback (most recent call last):
  File "ggsl.py", line 116, in ?
    V,H,P = g_arnoldi(A,B,R0,n,s,k)
  File "ggsl.py", line 78, in g_arnoldi
    H[i,j] = trace(dot(Vi.transpose(),VT))
  File "/usr/lib64/python2.4/site-packages/scipy/sparse/sparse.py", line
214, in __getattr__
    raise AttributeError, attr + " not found"
AttributeError: __float__ not found

Is this a bug ?


More information about the Scipy-dev mailing list