[Numpy-discussion] Bug in resize method?
Charles R Harris
charlesr.harris at gmail.com
Wed Aug 29 15:14:54 EDT 2007
On 8/29/07, Timothy Hochberg <tim.hochberg at ieee.org> wrote:
> On 8/29/07, Charles R Harris <charlesr.harris at gmail.com> wrote:
> > I still don't see why the method is needed at all. Given the conditions
> > on the array, the only thing it buys you over the resize function or a
> > reshape is the automatic deletion of the old memory if new memory is
> > allocated.
> Can you explain this more? Both you and Anne seem to share the opinion
> that the resize method is useless, while the resize function is useful. So,
> now I'm worried I'm missing something since as far as I can tell the
> function is useless and the method is only mostly useless.
Heh. I might dump both. The resize function is a concatenation followed by
reshape. It differs from the resize method in that it always returns a new
array and repeats the data instead of filling with zeros. The inconsistency
in the way the array is filled bothers me a bit, I would have just named
the method realloc. I really don't see the need for either except for
backward compatibility. Maybe someone can make a case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion