MA is one of the optional Packages and installing it requires a separate step as explained in the numarray README. To install just the MA package using Distutils, in the MA top directory enter:
python setup.py install
from 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 MA, so to execute a method foo from Numeric, you can reference it as numarray.foo.
Usually people use both MA and Numeric this way, but of course you can always fully-qualify the names:
>>> import MA >>> x = MA.array([1, 2, 3])
The principal feature of module MA is class MaskedArray, the class whose instances are returned by the array constructors and most functions in module MA. We will discuss this class first, and later cover the attributes and functions in module 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.