|
From: Alexander B. <ale...@gm...> - 2006-01-06 04:50:53
|
the following session demonstrates the difference between numpy.ma and old MA behavior. Sum ndarray and ma.array is ndarray >>> type(numeric.array([1])+ma.array([1])) <type 'numpy.ndarray'> However, taken in the different order, >>> type(ma.array([1])+numeric.array([1])) <class 'numpy.core.ma.MaskedArray'> In the old MA module the sum is MaskedArray in any order: >>> type(MA.array([1])+Numeric.array([1])) <class 'MA.MaskedArray'> >>> type(Numeric.array([1])+MA.array([1])) <class 'MA.MaskedArray'> I suspected that new ma module may not have __radd__ defined, but it does. Can anyone explain this? Thanks. -- sasha PS: >>> import numpy >>> numpy.__version__ '0.9.3.1831' |