<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR></HEAD>
<BODY>
<P><FONT size=2>Sorry this is in HTML, but the documentation below requires 
it.</FONT></P>
<P><FONT size=2>The latest source release is 17.2.0.<BR><BR>Revised 
documentation in HTML and PDF is available at <A target=_blank 
href="http://numpy.sourceforge.net">http://numpy.sourceforge.net</A>.<BR><BR>Package 
MA contains a number of new constructors. The complete list is:</P>
<H6 class=FM2Heading><A name=pgfId-298181></A><A name=73354></A>Constructing 
masked arrays</H6>
<OL>
  <LI class=Numbered1><A name=pgfId-305574></A><A name=marker-305800></A>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. 
  <LI class=Numbered><A name=pgfId-305587></A><A 
  name=marker-305801></A>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. 
  <LI class=Numbered><A name=pgfId-303765></A><A 
  name=marker-304072></A>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 <BR>abs (data - value) < atol + rtol * abs 
  (data). <BR>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. 
  <LI class=Numbered><A name=pgfId-305796></A><A 
  name=marker-305802></A>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. 
  <LI class=Numbered><A name=pgfId-307728></A><A 
  name=marker-307732></A>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. 
  <LI class=Numbered><A name=pgfId-307764></A><A 
  name=marker-307789></A>masked_greater (data, value) is equivalent to 
  masked_where (greater(data, value), data)). Similarly, <A 
  name=marker-307793></A>masked_greater_equal, <A 
  name=marker-307797></A>masked_equal, <A 
  name=marker-307801></A>masked_not_equal, <A 
  name=marker-307805></A>masked_less, <A 
  name=marker-307809></A>masked_less_equal are called in the same way with the 
  obvious meanings. Note that for floating point data, <A 
  name=marker-307810></A>masked_values is preferable to masked_equal in most 
  cases. </LI></OL>
<P class=Body><A name=pgfId-305283></A>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.</P>
<P class=Body><A name=pgfId-306531></A>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.</P>
<P><FONT face=Arial></FONT><BR><BR></FONT></P></BODY></HTML>