[Numpy-tickets] [NumPy] #613: resize on an empty array fails in some cases, very weird

NumPy numpy-tickets@scipy....
Wed Nov 14 04:32:04 CST 2007


#613: resize on an empty array fails in some cases, very weird
------------------------+---------------------------------------------------
 Reporter:  tovrstra    |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  low         |   Milestone:  1.0.5   
Component:  numpy.core  |     Version:  none    
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 The problem is rather simple and probably not hurting many people. This
 works:

 {{{
 >>> a = numpy.zeros(0)
 >>> a.resize(5)
 >>> a
 array([ 0.,  0.,  0.,  0.,  0.])
 }}}

 This doesn't:

 {{{
 >>> a = numpy.zeros(0)
 >>> a
 array([], dtype=float64)
 >>> a.resize(5)
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 ValueError: cannot resize an array that has been referenced or is
 referencing
 another array in this way.  Use the resize function
 }}}

 I'm not sure whether this is a real problem, but it is at least a bit
 confusing.

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/613>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list