May 14, 2003
1:19 p.m.
What is the official way to zero out an array in numarray/Numeric? While I can create a new array of all zeros and then assign it to the old variable, this is extremely wasteful of memory. Currently, I am just using:
import numarray a = numarray.arange(6) a array([0, 1, 2, 3, 4, 5]) a[:] = 0.0 a array([0, 0, 0, 0, 0, 0])
I looked through the manual for a function or array mathod which would accomplish the same thing, but I didn't find an obvious one. Did I miss something obvious? Thanks, -a