[SciPy-user] Sparse matrices

Nils Wagner nwagner at mecha.uni-stuttgart.de
Wed Nov 10 10:44:41 CST 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 ?



More information about the SciPy-user mailing list