[Numpy-discussion] Bug in resize method?

Charles R Harris charlesr.harris@gmail....
Wed Aug 29 10:42:50 CDT 2007


Hi all,

This looks like a bug to me.

>>> a = arange(6).reshape(2,3)
>>> a.resize((3,3))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: cannot resize this array:  it does not own its data

Is there any reason resize should fail in this case? Resize should be
returning an new array, no? There are several other things that
look like bugs in this method, for instance:

>>> a = arange(6).resize((2,3))
>>> a

`a` has no value and no error is raised.

The resize function works as expected

>>> resize(a,(3,3))
array([[0, 1, 2],
       [3, 4, 5],
       [0, 1, 2]])

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070829/f858ebec/attachment.html 


More information about the Numpy-discussion mailing list