[Numpy-discussion] Resizing without allocating additional memory

David Huard david.huard at gmail.com
Wed Dec 6 09:21:44 CST 2006


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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061206/2680f7e7/attachment.html 

More information about the Numpy-discussion mailing list