[Scipy-tickets] [SciPy] #226: sparse.lil_matrix doesn't support inplace operations with fancy indexing

SciPy scipy-tickets@scipy....
Fri Jan 23 21:40:51 CST 2009


#226: sparse.lil_matrix doesn't support inplace operations with fancy indexing
--------------------------+-------------------------------------------------
 Reporter:  NeilenMarais  |        Owner:  edschofield
     Type:  enhancement   |       Status:  assigned   
 Priority:  normal        |    Milestone:  0.8.0      
Component:  scipy.sparse  |      Version:             
 Severity:  normal        |   Resolution:             
 Keywords:                |  
--------------------------+-------------------------------------------------
Comment (by AndrewStraw):

 I think the exception should come at the time of fancy indexing, not on
 the call to mat.todense().

 {{{
 import numpy as np
 from scipy.sparse import lil_matrix

 A = lil_matrix((20,20))
 c = np.array([1,4,0])
 vals = np.array([10.0, 20.0, 30.0])

 A[c,0] = vals     # The failure should be here, but it is not.
 A.todense()       # Instead, this fails.
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/226#comment:5>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list