[SciPy-User] SPARSE matrix dtypes, upcasting, sum function

Oleksandr Huziy guziy.sasha at gmail.com
Thu Sep 8 09:20:23 EDT 2011


Maybe the problem that uint8 cannot be greater than 255.

__
Oleksandr Huziy

2011/9/8 Dinesh B Vadhia <dineshbvadhia at hotmail.com>

> **
> We have:
>
> I > 250000, J > 250000, nnz>10000000
>
> data = scipy.ones(nnz, dtype=numpy.uint8)
> A = sparse.csr_matrix((data, (xrow, xcolumn)), shape=(I,J))
>
> where xrow and xcolumn are int vectors of length nnz
>
> The row and column sums are:
> rowsum = A.sum(0)
> columnsum = A.sum(1)
>
> The max value given for each by Scipy are:
> rowsum .max() = 255
> columnsum .max() = 255
>
> But, the real values are:
> rowsum .max() = 41190
> columnsum .max() = 1080
>
> Can someone see what we are doing wrong?
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110908/b22e0124/attachment.html>


More information about the SciPy-User mailing list