[Scipy-tickets] [SciPy] #754: scipy.sparse: coo_matrix.tocsr, coo_matrix.tocsc ignore sum_duplicates

SciPy scipy-tickets@scipy....
Mon Oct 13 09:02:47 CDT 2008


#754: scipy.sparse: coo_matrix.tocsr,coo_matrix.tocsc ignore sum_duplicates
--------------------------+-------------------------------------------------
 Reporter:  shashmik      |       Owner:  wnbell
     Type:  defect        |      Status:  new   
 Priority:  normal        |   Milestone:        
Component:  scipy.sparse  |     Version:  devel 
 Severity:  normal        |    Keywords:        
--------------------------+-------------------------------------------------
 Running scipy version 0.7.0.dev4763

 coo_matrix.tocsr + tocsc both ignore the sum_duplicates parameter:


 {{{
 In [1]: from numpy import *
 In [2]: from scipy.sparse import *
 In [3]: data = array([1,1,1,1,1,1,1])
 In [4]: row  = array([0,0,1,3,1,0,0])
 In [5]: col  = array([0,2,1,3,1,0,0])
 In [6]: A = coo_matrix( (data,(row,col)), shape=(4,4))
 In [8]: A.tocsr(sum_duplicates=False).todense()
 Out[8]:
 matrix([[3, 0, 1, 0],
         [0, 2, 0, 0],
         [0, 0, 0, 0],
         [0, 0, 0, 1]])
 In [9]: A.tocsc(sum_duplicates=False).todense()
 Out[9]:
 matrix([[3, 0, 1, 0],
         [0, 2, 0, 0],
         [0, 0, 0, 0],
         [0, 0, 0, 1]])
 }}}

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


More information about the Scipy-tickets mailing list