[SciPy-user] [Sparse matrix library] csr_matrix and column sum

David Cournapeau david at ar.media.kyoto-u.ac.jp
Mon Apr 28 00:56:22 EDT 2008


Dinesh B Vadhia wrote:
> I'm using the svn.  There is no Traceback error but the results are 
> incorrect based on previous results.  Here is ouput from print 
> statements that might help:
>  
> > import numpy
> > import scipy
> > from scipy import sparse
>  
> > colSum = scipy.asmatrix(scipy.zeros((1,J), dtype=numpy.float))
> > colSum = A.sum(0)            # A is a csr_matrix

I don't know if this is intended, but the first line has no effect 
(scipy.asmatrix: the call is wasteful because colSum will be assigned to 
A.sum(0) just after). We need the A matrix.

David



More information about the SciPy-User mailing list