[Numpy-discussion] Unexpected behaviour by in place addition of array and masked array

Pierre GM pgmdevlist@gmail....
Thu Apr 24 08:55:18 CDT 2008


On Thursday 24 April 2008 05:35:41 Hanno Klemm wrote:
> >>> N.__version__
> '1.0.4'

OK, you're using the "old" version of masked array.

> I tried adding a masked array and a usual array in place and got back
> the usual array. Is this expected behaviour? I would have expected to
> get a masked array back.

Yes, it is expected: as you're adding in place, you can't change the nature of 
the array, so a ndarray will stay a ndarray. Following the same line, adding 
a float array in place to a int array will give you a int array.

More information about the Numpy-discussion mailing list