[SciPy-User] strange error when creating csr_matrix

Rok Roskar rokroskar at gmail.com
Tue Mar 31 12:51:38 EDT 2015


aha good to know, thanks -- I suppose there isn't an easy work-around for
the time being?


On Tue, Mar 31, 2015 at 6:35 PM, Pauli Virtanen <pav at iki.fi> wrote:

> 31.03.2015, 10:34, Rok Roskar kirjoitti:
> > Hi Pauli, thanks for the idea. I think the arrays are int64 by default,
> so
> > this doesn't seem make a difference:
> >
> > In [23]: csr_matrix((vals.astype(np.int64), (np.zeros(10,dtype=np.int64),
> > inds.astype(np.int64))), shape = (1, max_index+1))
> >
> ---------------------------------------------------------------------------
> > ValueError                                Traceback (most recent call
> last)
> >
> > <snip>
> >
> > ValueError: could not convert integer scalar
> >
> > Does it work on your machine?
>
> Turns out this is actually a bug:
> https://github.com/scipy/scipy/pull/4678
>
> csr_matrix constructor thinks 32-bit integers are enough, but this is
> not the case.
>
> _______________________________________________
> 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/20150331/39d85b97/attachment.html>


More information about the SciPy-User mailing list