MaskedArray.copy()

MaskedArray.copy(order='C') [source] Return a copy of the array. Parameters: order : {?C?, ?F?, ?A?, ?K?}, optional Controls the memory layout of the copy. ?C? means C-order, ?F? means F-order, ?A? means ?F? if a is Fortran contiguous, ?C? otherwise. ?K? means match the layout of a as closely as possible. (Note that this function and :func:numpy.copy are very similar, but have different default values for their order= arguments.) See also numpy.copy, numpy.copyto Examples >>>

MaskedArray.compress()

MaskedArray.compress(condition, axis=None, out=None) [source] Return a where condition is True. If condition is a MaskedArray, missing values are considered as False. Parameters: condition : var Boolean 1-d array selecting which entries to return. If len(condition) is less than the size of a along the axis, then output is truncated to length of condition array. axis : {None, int}, optional Axis along which the operation must be performed. out : {None, ndarray}, optional Alternative ou

MaskedArray.conj()

MaskedArray.conj() Complex-conjugate all elements. Refer to numpy.conjugate for full documentation. See also numpy.conjugate equivalent function

MaskedArray.compressed()

MaskedArray.compressed() [source] Return all the non-masked data as a 1-D array. Returns: data : ndarray A new ndarray holding the non-masked data is returned. Notes The result is not a MaskedArray! Examples >>> x = np.ma.array(np.arange(5), mask=[0]*2 + [1]*3) >>> x.compressed() array([0, 1]) >>> type(x.compressed()) <type 'numpy.ndarray'>

MaskedArray.choose()

MaskedArray.choose(choices, out=None, mode='raise') Use an index array to construct a new array from a set of choices. Refer to numpy.choose for full documentation. See also numpy.choose equivalent function

MaskedArray.clip()

MaskedArray.clip(min=None, max=None, out=None) [source] Return an array whose values are limited to [min, max]. One of max or min must be given. Refer to numpy.clip for full documentation. See also numpy.clip equivalent function

MaskedArray.astype()

MaskedArray.astype(newtype) [source] Returns a copy of the MaskedArray cast to given newtype. Returns: output : MaskedArray A copy of self cast to input newtype. The returned record shape matches self.shape. Examples >>> x = np.ma.array([[1,2,3.1],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4) >>> print(x) [[1.0 -- 3.1] [-- 5.0 --] [7.0 -- 9.0]] >>> print(x.astype(int32)) [[1 -- 3] [-- 5 --] [7 -- 9]]

MaskedArray.byteswap()

MaskedArray.byteswap(inplace) Swap the bytes of the array elements Toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place. Parameters: inplace : bool, optional If True, swap bytes in-place, default is False. Returns: out : ndarray The byteswapped array. If inplace is True, this is a view to self. Examples >>> A = np.array([1, 256, 8755], dtype=np.int16) >>> map(hex, A) ['0x1', '0x100', '0x2233'] &g

MaskedArray.base

MaskedArray.base Base object if memory is from some other object. Examples The base of an array that owns its memory is None: >>> x = np.array([1,2,3,4]) >>> x.base is None True Slicing creates a view, whose memory is shared with x: >>> y = x[2:] >>> y.base is x True

MaskedArray.argmax()

MaskedArray.argmax(axis=None, fill_value=None, out=None) [source] Returns array of indices of the maximum values along the given axis. Masked values are treated as if they had the value fill_value. Parameters: axis : {None, integer} If None, the index is into the flattened array, otherwise along the specified axis fill_value : {var}, optional Value used to fill in the masked values. If None, the output of maximum_fill_value(self._data) is used instead. out : {None, array}, optional Ar