Version 1.0b1 API Documentation generated by Endo 2006-08-14
MA: a facility for dealing with missing observations MA is generally used as a numpy.array look-alike. by Paul F. Dubois.
Copyright 1999, 2000, 2001 Regents of the University of California. Released for unlimited redistribution. Adapted for numpy_core 2005 by Travis Oliphant and (mainly) Paul Dubois.
MaskType = bool_
absolute = masked_unary_operation(umath.absolute)
add = masked_binary_operation(umath.add)
alltrue = masked_binary_operation(umath.logical_and, 1, 1).reduce
arccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-Const(1.0), 1.0))
arccosh = masked_unary_operation(umath.arccosh, 1.0, domain_greater_equal(1.0))
arcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-Const(1.0), 1.0))
Missing from numeric
arcsinh = masked_unary_operation(umath.arcsinh)
arctan = masked_unary_operation(umath.arctan)
arctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0)
arctanh = masked_unary_operation(umath.arctanh, 0.0, domain_check_interval((-Const(1.0) + 1.0000000000000001e-015), (1.0 - 1.0000000000000001e-015)))
around = masked_unary_operation(fromnumeric.round_)
array = MaskedArray
arrayrange = arange
bitwise_and = masked_binary_operation(umath.bitwise_and)
bitwise_or = masked_binary_operation(umath.bitwise_or)
bitwise_xor = masked_binary_operation(umath.bitwise_xor)
ceil = masked_unary_operation(umath.ceil)
conjugate = masked_unary_operation(umath.conjugate)
cos = masked_unary_operation(umath.cos)
cosh = masked_unary_operation(umath.cosh)
default_character_fill_value = '-'
default_complex_fill_value = (1e+020 + 0j)
default_integer_fill_value = 999999
default_object_fill_value = '?'
Use single element arrays or scalars.
default_real_fill_value = 1e+020
divide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1)
divide_tolerance = 1e-035
equal = masked_binary_operation(umath.equal)
exp = masked_unary_operation(umath.exp)
fabs = masked_unary_operation(umath.fabs)
floor = masked_unary_operation(umath.floor)
floor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1)
fmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1)
greater = masked_binary_operation(umath.greater)
greater_equal = masked_binary_operation(umath.greater_equal)
hypot = masked_binary_operation(umath.hypot)
innerproduct = inner
isMA = isMaskedArray
isarray = isMaskedArray
less = masked_binary_operation(umath.less)
less_equal = masked_binary_operation(umath.less_equal)
log = masked_unary_operation(umath.log, 1.0, domain_greater(0.0))
log10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0))
logical_and = masked_binary_operation(umath.logical_and)
logical_not = masked_unary_operation(umath.logical_not)
logical_or = masked_binary_operation(umath.logical_or)
logical_xor = masked_binary_operation(umath.logical_xor)
masked = MaskedArray(0, int, mask = 1)
if you single index into a masked location you get this object.
masked_print_option = _MaskedPrintOption('--')
maximum = _maximum_operation()
minimum = _minimum_operation()
multiply = masked_binary_operation(umath.multiply, 1, 1)
negative = masked_unary_operation(umath.negative)
nomask = MaskType(0)
not_equal = masked_binary_operation(umath.not_equal)
outerproduct = outer
product = multiply.reduce
remainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1)
sin = masked_unary_operation(umath.sin)
sinh = masked_unary_operation(umath.sinh)
sometrue = logical_or.reduce
sqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0))
subtract = masked_binary_operation(umath.subtract)
sum = add.reduce
tan = masked_unary_operation(umath.tan, 0.0, domain_tan(1e-035))
tanh = masked_unary_operation(umath.tanh)
true_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1)
Ufunc domain lookup for __array_wrap__
ufunc_domain = { }
Ufunc fills lookup for __array__
ufunc_fills = { }
Returns true if all components of a and b are equal subject to given tolerances. If fill_value is 1, masked values considered equal. If fill_value is 0, masked values considered unequal. The relative error rtol should be positive and << 1.0 The absolute error atol comes into play for those elements of b that are very small or zero; it says how small a must be also.
True if all entries of a and b are equal, using fill_value as a truth value where either or both are masked.
Just like range() except it returns a array whose type can be specified by the keyword argument dtype.
Treating masked values as if they have the value fill_value, return sort indices for maximum along given axis. if fill_value is None, use -get_fill_value(x) if it exists. Returns a numpy array if x has more than one dimension. Otherwise, returns a scalar index.
Treating masked values as if they have the value fill_value, return indices for minimum values along given axis. if fill_value is None, use get_fill_value(x). Returns a numpy array if x has more than one dimension. Otherwise, returns a scalar index.
Treating masked values as if they have the value fill_value, return sort indices for sorting along given axis. if fill_value is None, use get_fill_value(x) Returns a numpy array.
asarray(data, dtype) = array(data, dtype, copy=0)
average(a, axis=0, weights=None) Computes average along indicated axis. If axis is None, average over the entire array Inputs can be integer or floating types; result is of type float.
If weights are given, result is sum(a*weights)/(sum(weights)*1.0) weights must have a's shape or be the 1-d with length the size of a in the given axis.
If returned, return a tuple: the result and the sum of the weights or count of values. Results will have the same shape.
masked values in the weights will be set to 0.0
Returns array shaped like indices with elements chosen from t
The common fill_value of a and b, if there is one, or None
Select those parts of x for which condition is true. Masked values in condition are considered false.
Concatenate the arrays along the given axis
Count of the non-masked elements in a, or along a certain axis.
Function to calculate default fill value for an object.
diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a
dot(a,b) returns matrix-multiplication between a and b. The product-sum is over the last dimension of a and the second-to-last dimension of b. Masked values are replaced by zeros. See also innerproduct.
a as a contiguous numeric array with any masked areas replaced by value if value is None or the special element "masked", get_fill_value(a) is used instead.
If a is already a contiguous numeric array, a itself is returned.
filled(a) can be used to be sure that the result is numeric when passing an object a to other software ignorant of MA, in particular to numeric itself.
apply f to s to create array as in umath.
Construct a masked array from a string. Result will have no mask.
The fill value of a, if it has one; otherwise, the default fill value for that type.
Mask of values in a; could be nomask. Returns nomask if a is not a masked array. To get an array for sure use getmaskarray.
Mask of values in a; an array of zeros if mask is nomask or not a masked array, and is a byte-sized integer. Do not try to add up entries, for example.
identity(n) returns the identity matrix of shape n x n.
indices(dimensions,dtype=None) returns an array representing a grid of indices with row-only, and column-only variation.
inner(a,b) returns the dot product of two arrays, which has shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the product of the elements from the last dimensions of a and b. Masked elements are replace by zeros.
Is x a masked array, that is, an instance of MaskedArray?
Is m a legal mask? Does not check contents, only type.
Left shift n bits
make_mask(m, copy=0, flag=0) return m as a mask, creating a copy if necessary or requested. Can accept any sequence of integers or nomask. Does not check that contents must be 0s and 1s. if flag, return nomask if m contains no true elements.
Return a mask of all zeros of shape s.
Logical or of the mask candidates m1 and m2, treating nomask as false. Result may equal m1 or m2 if the other is nomask.
masked_array(a, mask=nomask) = array(a, mask=mask, copy=0, fill_value=fill_value)
masked_equal(x, value) = x masked where x == value For floating point consider masked_values(x, value) instead.
masked_greater(x, value) = x masked where x > value
masked_greater_equal(x, value) = x masked where x >= value
x with mask of all values of x that are inside [v1,v2] v1 and v2 can be given in either order.
masked_less(x, value) = x masked where x < value
masked_less_equal(x, value) = x masked where x <= value
masked_not_equal(x, value) = x masked where x != value
Create array masked where exactly data equal to value
x with mask of all values of x that are outside [v1,v2] v1 and v2 can be given in either order.
masked_values(data, value, rtol=1.e-5, atol=1.e-8) Create a masked array; mask is nomask if possible. If copy==0, and otherwise possible, result may share data values with original array. Let d = filled(data, value). Returns d masked where abs(data-value)<= atol + rtol * abs(value) if d is of a floating point type. Otherwise returns masked_object(d, value, copy)
Return x as an array masked where condition is true. Also masked where x or condition masked.
Function to calculate default fill value suitable for taking maxima.
Function to calculate default fill value suitable for taking minima.
returns the indices of the elements of a which are not zero and not masked
a must be 1d
ones(n, dtype=int) = an array of all ones of the given length or shape.
outer(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))
a**b
put(a, indices, values) sets storage-indexed locations to corresponding values.
Values and indices are filled if necessary.
putmask(a, mask, values) sets a where mask is true.
a as one-dimensional, may share data and mask
repeat elements of a repeats times along axis repeats is a sequence of length a.shape[axis] telling how many times to repeat each element.
Copy of a with a new shape.
resize(a, new_shape) returns a new array with the specified shape. The original array's total size can be any size.
Right shift n bits
Set fill value of a if it is a masked array.
If x does not have a mask, return a masked array formed from the result of numeric.sort(x, axis). Otherwise, fill x with fill_value. Sort it. Set a mask where the result is equal to fill_value. Note that this may have unintended consequences if the data contains the fill value at a non-masked site.
If fill_value is not given the default fill value for x's type will be used.
take(a, indices, axis=0) returns selection of items from a.
trace(a,offset=0, axis1=0, axis2=1) returns the sum along diagonals (defined by the last two dimenions) of the array.
transpose(a, axes=None) reorder dimensions per tuple axes
where(condition, x, y) is x where condition is nonzero, y otherwise. condition must be convertible to an integer array. Answer is always the shape of condition. The type depends on x and y. It is integer if both x and y are the value masked.
zeros(n, dtype=int) = an array of all zeros of the given length or shape.
| Local name | Refers to |
|---|---|
| amax | numpy.core.fromnumeric.amax |
| amin | numpy.core.fromnumeric.amin |
| fromnumeric | numpy.core.fromnumeric |
| MethodType | types.MethodType |
| ndarray | multiarray.ndarray |
| newaxis | numpy.core.numeric.newaxis |
| numeric | numpy.core.numeric |
| sys | sys |
| typecodes | numpy.core.numerictypes.typecodes |
| types | types |
| umath | umath |
| warnings | warnings |