[Numpy-discussion] Documentation updated
Paul F. Dubois
pauldubois at home.com
Fri Dec 29 13:23:43 CST 2000
Sorry this is in HTML, but the documentation below requires it.
The latest source release is 17.2.0.
Revised documentation in HTML and PDF is available at
http://numpy.sourceforge.net.
Package MA contains a number of new constructors. The complete list is:
Constructing masked arrays
1.. array (data, typecode = None, copy = 1, savespace = 0, mask = None,
fill_value = None) creates a masked array with the given data and mask. The
name array is simply an alias for the class name, MA. This constructor sets
the data area of the resulting masked array to filled (data, value =
fill_value, copy = copy, savespace = savespace), the mask to make_mask
(mask, savespace), and the fill value is set to fill_value. The class name
MA may also be used instead of the name array.
2.. masked_array (data, mask = None, fill_value = None) is an easier to
use version of array, for the common case of typecode = None, copy = 0. When
data is newly-created this function can be used to make it a masked array
without copying the data if data is already a Numeric array.
3.. masked_values (data, value, rtol=1.e-5, atol=1.e-8, typecode = None,
copy = 1, savespace = 0) constructs a masked array whose mask is set at
those places where
abs (data - value) < atol + rtol * abs (data).
That is a careful way of saying that those elements of the data that have
value = value (to within a tolerance) are to be treated as invalid.
4.. masked_object (data, value, copy=1, savespace=0) creates a masked
array with those entries marked invalid that are equal to value. Again, copy
and savespace are passed on to the Numeric array constructor.
5.. masked_where (condition, data) creates a masked array whose shape is
that of condition, whose values are those of data, and which is masked where
elements of condition are true.
6.. masked_greater (data, value) is equivalent to masked_where
(greater(data, value), data)). Similarly, masked_greater_equal,
masked_equal, masked_not_equal, masked_less, masked_less_equal are called in
the same way with the obvious meanings. Note that for floating point data,
masked_values is preferable to masked_equal in most cases.
On entry to any of these constructors, data must be any object which the
Numeric package can accept to create an array (with the desired typecode, if
specified). The mask if given must be None or any object that can be turned
into a Numeric array of integer type (it will be converted to typecode
MaskType, if necessary), have the same shape as data, and contain only
values of 0 or 1.
If the mask is not None but its shape does not match that of data, an
exception will be thrown, unless one of the two is of length 1, in which
case the scalar will be resized (using Numeric.resize) to match the other.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20001229/57bc2c52/attachment-0001.html
More information about the Numpy-discussion
mailing list