[Numpy-discussion] Bug in resize method?

Charles R Harris charlesr.harris at gmail.com
Wed Aug 29 11:42:50 EDT 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]])

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070829/f858ebec/attachment.html>

More information about the NumPy-Discussion mailing list