numpy.triu_indices()

numpy.triu_indices(n, k=0, m=None) [source] Return the indices for the upper-triangle of an (n, m) array. Parameters: n : int The size of the arrays for which the returned indices will be valid. k : int, optional Diagonal offset (see triu for details). m : int, optional New in version 1.9.0. The column dimension of the arrays for which the returned arrays will be valid. By default m is taken equal to n. Returns: inds : tuple, shape(2) of ndarrays, shape(n) The indices for the tr

chararray.size

chararray.size Number of elements in the array. Equivalent to np.prod(a.shape), i.e., the product of the array?s dimensions. Examples >>> x = np.zeros((3, 5, 2), dtype=np.complex128) >>> x.size 30 >>> np.prod(x.shape) 30

Array manipulation routines

Basic operations copyto(dst, src[, casting, where]) Copies values from one array to another, broadcasting as necessary. Changing array shape reshape(a, newshape[, order]) Gives a new shape to an array without changing its data. ravel(a[, order]) Return a contiguous flattened array. ndarray.flat A 1-D iterator over the array. ndarray.flatten([order]) Return a copy of the array collapsed into one dimension. Transpose-like operations moveaxis(a, source, destination) Move axes of an arra

numpy.nanpercentile()

numpy.nanpercentile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear', keepdims=False) [source] Compute the qth percentile of the data along the specified axis, while ignoring nan values. Returns the qth percentile(s) of the array elements. New in version 1.9.0. Parameters: a : array_like Input array or object that can be converted to an array. q : float in range of [0,100] (or sequence of floats) Percentile to compute, which must be between 0 and 100 inclusive.

generic.any()

generic.any() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also The

numpy.copyto()

numpy.copyto(dst, src, casting='same_kind', where=None) Copies values from one array to another, broadcasting as necessary. Raises a TypeError if the casting rule is violated, and if where is provided, it selects which elements to copy. New in version 1.7.0. Parameters: dst : ndarray The array into which values are copied. src : array_like The array from which values are copied. casting : {?no?, ?equiv?, ?safe?, ?same_kind?, ?unsafe?}, optional Controls what kind of data casting may

numpy.ma.masked

In addition to the MaskedArray class, the numpy.ma module defines several constants. numpy.ma.masked The masked constant is a special case of MaskedArray, with a float datatype and a null shape. It is used to test whether a specific entry of a masked array is masked, or to mask one or several entries of a masked array: >>> x = ma.array([1, 2, 3], mask=[0, 1, 0]) >>> x[1] is ma.masked True >>> x[-1] = ma.masked >>> x masked_array(data = [1 -- --],

numpy.ma.around

numpy.ma.around = Round an array to the given number of decimals. Refer to around for full documentation. See also around equivalent function

numpy.polynomial.legendre.legx

numpy.polynomial.legendre.legx = array([0, 1])

MaskedArray.view()

MaskedArray.view(dtype=None, type=None) [source] New view of array with the same data. Parameters: dtype : data-type or ndarray sub-class, optional Data-type descriptor of the returned view, e.g., float32 or int16. The default, None, results in the view having the same data-type as a. This argument can also be specified as an ndarray sub-class, which then specifies the type of the returned object (this is equivalent to setting the type parameter). type : Python type, optional Type of th