sparse matrix multiplication
2 Mar
2005
2 Mar
'05
2:20 a.m.
Hi - I am wondering if there is a problem with the following code: from scipy_base import * from scipy.sparse import csc_matrix, dok_matrix x = dok_matrix() x[0,0] = 2 x[1,1] = 1 x[2,1] = 1 y = csc_matrix(x) yt = y.transp() yy = yt * y print yy.todense() The print statement gives: [[ 4. 0.] [ 2. 0.]] When the answer I was expecting was: array([[4, 0], [0, 2]]) Thanks in advance... ---- Msg sent via - People Telecom Webmail
7154
Age (days ago)
7154
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andrew Swan