[Scipy-tickets] [SciPy] #1602: Sparse matrices do not allow a dimension to have length 0

SciPy Trac scipy-tickets@scipy....
Tue Feb 21 09:52:42 CST 2012


#1602: Sparse matrices do not allow a dimension to have length 0
--------------------------+-------------------------------------------------
 Reporter:  jluttine      |       Owner:  wnbell     
     Type:  defect        |      Status:  new        
 Priority:  normal        |   Milestone:  Unscheduled
Component:  scipy.sparse  |     Version:  0.10.0     
 Keywords:                |  
--------------------------+-------------------------------------------------
 Although numpy arrays and matrices allow a dimension to have length 0,
 sparse matrices do not allow this. Consider the following piece of code:
 {{{
 import numpy
 import scipy.sparse
 A = numpy.ones((0,0)) # this is ok
 B = numpy.asmatrix(A) # this is ok
 C = scipy.sparse.csc_matrix(A) # this fails
 }}}
 The last line results in an error:
 {{{
 ValueError: invalid shape
 }}}

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


More information about the Scipy-tickets mailing list