Use numarray.ma as a replacement for numarray:
from numarray.ma import * >>> x = array([1, 2, 3])
>>> y = array([1, 2, 3], mask = [0, 1, 0])
>>> z = masked_values([1.0, 1.e20, 3.0, 4.0], 1.e20)
The numarray module is an attribute in numarray.ma, so to execute a method foo from numarray, you can reference it as numarray.foo.
Usually people use both numarray.ma and numarray this way, but of course you can always fully-qualify the names:
>>> import numarray.ma >>> x = numarray.ma.array([1, 2, 3])
The principal feature of module numarray.ma is class MaskedArray, the class whose instances are returned by the array constructors and most functions in module numarray.ma. We will discuss this class first, and later cover the attributes and functions in module numarray.ma. For now suffice it to say that among the attributes of the module are the constants from module numarray including those for declaring typecodes, NewAxis, and the mathematical constants such as pi and e. An additional typecode, MaskType, is the typecode used for masks.
Send comments to the NumArray community.