[Numpy-discussion] Resizing without allocating additional memory
by David Huard other posts by this author
Dec 6 2006 7:47AM messages near this date
Re: [Numpy-discussion] Indices returned by where()
|
Re: [Numpy-discussion] Resizing without allocating additional memory
Hi,
I have fortran subroutines wrapped with f2py that take arrays as arguments,
and I often need to use resize(a, N) to pass an array of copies of an
element. The resize call , however, is becoming the speed bottleneck, so my
question is:
Is it possible to create an (1xN) array from a scalar without allocating
additional memory for the array, ie just return a new "view" of the array
where all elements point to the same scalar.
Thanks,
David
Thread:
David Huard
Travis Oliphant
David Huard
|