[SciPy-user] SciPy_Tutorial sparse examples broken
Nathan Bell
wnbell@gmail....
Thu Mar 12 23:35:29 CDT 2009
On Thu, Mar 12, 2009 at 6:12 PM, Kael Fischer <kael.fischer@gmail.com> wrote:
> The "new" Tutorial (most of it is from 2006) sparse matrix examples
> seem to have a problem. I'm using SciPy 0.7.0.b1 on FreeBSD 7.0R
> amd64.
>
> setup like this, per tutorial:
> ###
> Asp = sparse.lil_matrix((50000,50000))
> Asp.setdiag(ones(50000))
> b = arange(0,50000)
> ###
>
> Now Asp.tocsc(), Asp.tocsr(),linsolve.spsolve.(Asp,b) all work, but it
> you assign to Asp with some fancy indexing along dimension 0 tocsc and
> tocsr (and hence many other methods) fail. E.g.:
> ###
> Asp[200:250,30] = 10*random.rand(50)
> ### or ###
> Asp[0:3,30] = [1,2,3]
> ###
>
> followed by:
> ###
> Asp.tocsr()
> ---------------------------------------------------------------------------
> ValueError Traceback (most recent call last)
>
This seems to be related to ticket #226:
http://projects.scipy.org/scipy/ticket/226
I haven't had time to look at lil_matrix extensively, so I can't say
what the fundamental problem is here. It's clear that fancy
indexing/slicing with lil_matrix are broken though.
--
Nathan Bell wnbell@gmail.com
http://graphics.cs.uiuc.edu/~wnbell/
More information about the SciPy-user
mailing list