[Scipy-tickets] [SciPy] #755: dok_matrix ctor problems

SciPy scipy-tickets@scipy....
Mon Oct 13 09:42:39 CDT 2008


#755: dok_matrix ctor problems
--------------------------+-------------------------------------------------
 Reporter:  philbinj      |        Owner:  wnbell
     Type:  defect        |       Status:  new   
 Priority:  normal        |    Milestone:        
Component:  scipy.sparse  |      Version:  devel 
 Severity:  normal        |   Resolution:        
 Keywords:                |  
--------------------------+-------------------------------------------------
Comment (by philbinj):

 This also doesn't work:
 {{{
 In [15]: A = dok_matrix(shape=(10,10))
 Out[16]:
 ---------------------------------------------------------------------------
 <type 'exceptions.TypeError'>             Traceback (most recent call
 last)
 ...
 /usr/lib/python2.5/site-packages/scipy/sparse/base.py in __repr__(self)
     158         return "<%dx%d sparse matrix of type '%s'\n" \
     159                "\twith %d stored elements in %s format>" % \
 --> 160                (self.shape + (self.dtype.type, nnz,
 _formats[format][1]))
     161
     162     def __str__(self):
 <type 'exceptions.TypeError'>: unsupported operand type(s) for +:
 'NoneType' and 'tuple'
 }}}

 It seems that only the following works:
 {{{
 A = dok_matrix((10,10))
 }}}

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


More information about the Scipy-tickets mailing list