[SciPy-user] A.todense() for complex sparse matrices

Nils Wagner nwagner at mecha.uni-stuttgart.de
Fri Oct 22 04:58:29 EDT 2004


Python 2.3.3 (#1, Apr  6 2004, 01:47:39)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> from scipy import *
 >>> A = sparse.dok_matrix()
 >>> A[0,0] = 1j
 >>> A.todense()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 
1257, in todense
    new[ikey0,ikey1] = self[key]
TypeError: can't convert complex to float; use abs(z)
 >>>

 Nils






More information about the SciPy-User mailing list