[Numpy-discussion] MaskedArray and the min, max, sum, prod Methods

Pierre GM pgmdevlist@gmail....
Fri Jan 4 09:01:02 CST 2008


On Thursday 03 January 2008 15:49:45 Alexander Michael wrote:
> Working with the new MaskedArray, I noticed the following differences
>
> with numpy.array behavior:
> >>> masked_array([1, 2, 3], mask=True).min()
>
> 2147483647

That's a bug, the result should be maskedarray.masked. Samething for max, of 
course.

> >>> masked_array([1, 2, 3], mask=True).prod()
>
> masked_array(data = --,
>       mask = True,
>       fill_value=1e+020)
>
> >>> array([]).prod()
>
> 1.0

That's OK here, the result is maskedarray.masked. Ditto for sum


More information about the Numpy-discussion mailing list