[Numpy-tickets] [NumPy] #989: masked_array results differ between inplace and regular operators
NumPy
numpy-tickets@scipy....
Mon Jan 26 11:18:50 CST 2009
#989: masked_array results differ between inplace and regular operators
----------------------------+-----------------------------------------------
Reporter: danielmcdonald | Owner: pierregm
Type: defect | Status: new
Priority: normal | Milestone:
Component: numpy.ma | Version: 1.1.1
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
The result of a masked array addition differs between inplace math
operators and the regular math operators. The unexpected behavior results
in the regular operator, it appears that the 'mask' variable is not being
set in the same fashion. Below is interpreter output. NumPy 1.0.3 produces
the expected result, NumPy 1.1.1 and NumPy 1.2.1 do not.
The following output was produced using Python 2.5.2, NumPy 1.2.1 on an
OSX 10.5.6 x86 machine:
>>> from numpy import ma, array
>>> a = ma.array([1,2,3],mask=array([False,False,False]))
>>> a
masked_array(data = [1 2 3],
mask = [False False False],
fill_value=999999)
>>> a *= array([2,3,4])
>>> a
masked_array(data = [2 6 12],
mask = [False False False],
fill_value=999999)
>>> a = ma.array([1,2,3],mask=array([False,False,False]))
>>> a * array([2,3,4])
masked_array(data = [ 2 6 12],
mask = False,
fill_value=999999)
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/989>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list