[SciPy-user] A.mean(0) for sparse matrices

Dinesh B Vadhia dineshbvadhia@hotmail....
Mon Jul 7 20:33:45 CDT 2008


Binary sparse matrices are created as follows:

row = numpy.zeros(nnz, dtype='intc')
column = numpy.zeros(nnz, dtype='intc')
data = scipy.ones(nnz, dtype='intc')
A = sparse.csr_matrix((data, (row, column)), shape=(I,J))

Next, I want to get the mean of A with:

column_mean = A.mean(0)

I would expect column_mean to be a float vector but instead I get an integer vector.  Have I missed something?  

Dinesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080707/96827d05/attachment.html 


More information about the SciPy-user mailing list