Re: Sparse Matrix Multiplications

2008-05-13 Thread Peter Otten
Peter Otten wrote: > Peter Otten wrote: > >> # use at your own risk >> import numpy >> >> N = 10**4 # I get a MemoryError for a bigger exponent >> b = numpy.array(range(N)) >> a = numpy.zeros((N, N)) + b >> a *= a.transpose() >> a[0,0] = (b*b).sum() >> print a > > Sorry, this is nonsense. Mayb

Re: Sparse Matrix Multiplications

2008-05-13 Thread Peter Otten
Peter Otten wrote: > # use at your own risk > import numpy > > N = 10**4 # I get a MemoryError for a bigger exponent > b = numpy.array(range(N)) > a = numpy.zeros((N, N)) + b > a *= a.transpose() > a[0,0] = (b*b).sum() > print a Sorry, this is nonsense. -- http://mail.python.org/mailman/listin

Re: Sparse Matrix Multiplications

2008-05-13 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I was trying to create a sparse matrix using scipy.sparse (10 X > 10) with just the first row and first column filled with ones. > Lets call this matrix Asp. This is how I created Asp > > from scipy import sparse > Asp = scipy.lil_matrix(10,10) > for i i

Sparse Matrix Multiplications

2008-05-12 Thread dingo_1980
I was trying to create a sparse matrix using scipy.sparse (10 X 10) with just the first row and first column filled with ones. Lets call this matrix Asp. This is how I created Asp from scipy import sparse Asp = scipy.lil_matrix(10,10) for i in range(10): Asp[i,0] = i Asp[