[Numpy-discussion] Zeroing an existing array

Perry Greenfield perry at stsci.edu
Wed May 14 13:39:08 EDT 2003


> 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])
> 
Is there any reason for anything else if this does the job?
This is how I would recommend the action be performed.

Perry Greenfield 




More information about the NumPy-Discussion mailing list