[SciPy-user] Sparse matrices

Nils Wagner nwagner at mecha.uni-stuttgart.de
Wed Nov 10 11:44:41 EST 2004


Hi all,

from scipy import *
A = sparse.dok_matrix()

for i in range(3):
  A[i,i] = 0.0+0.0j
# A[i,i] = 0.1+0.0j

n,m = A.shape
print n,m
print A


n, m should be equal to 3, but this is only valid for non-zero entries.

Am I missing something ?

Nils

 





More information about the SciPy-User mailing list