[Numpy-discussion] Generically Creating Intermediate Data Compatible with Either ndarray or MasledArray Types

Alexander Michael lxander.m@gmail....
Tue Mar 11 14:57:30 CDT 2008

On Tue, Mar 11, 2008 at 3:42 PM, Eric Firing <efiring@hawaii.edu> wrote:
>  I don't know if it works for older versions of numpy, but with svn you
>  can simply use the astype() method of the array.  If the array is masked
>  it seems to work correctly, although it does not update the fill_value
>  to the default for the new type.

That will do even though I don't want to actually copy the data, as I
want an array to hold intermediate data of the same shape.

Incidentally, while ones_like appears to play nice with derived
classes, empty_like and zeros_like do not seem to do the same.

More information about the Numpy-discussion mailing list