[SciPy-user] A.mean(0) for sparse matrices
Dinesh B Vadhia
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user