numpy.matlib.eye()

numpy.matlib.eye(n, M=None, k=0, dtype=) [source] Return a matrix with ones on the diagonal and zeros elsewhere. Parameters: n : int Number of rows in the output. M : int, optional Number of columns in the output, defaults to n. k : int, optional Index of the diagonal: 0 refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal. dtype : dtype, optional Data-type of the returned matrix. Returns: I : matrix A n x M matrix w

numpy.matlib.empty()

numpy.matlib.empty(shape, dtype=None, order='C') [source] Return a new matrix of given shape and type, without initializing entries. Parameters: shape : int or tuple of int Shape of the empty matrix. dtype : data-type, optional Desired output data-type. order : {?C?, ?F?}, optional Whether to store multi-dimensional data in row-major (C-style) or column-major (Fortran-style) order in memory. See also empty_like, zeros Notes empty, unlike zeros, does not set the matrix values to ze

numpy.mat()

numpy.mat(data, dtype=None) [source] Interpret the input as a matrix. Unlike matrix, asmatrix does not make a copy if the input is already a matrix or an ndarray. Equivalent to matrix(data, copy=False). Parameters: data : array_like Input data. dtype : data-type Data-type of the output matrix. Returns: mat : matrix data interpreted as a matrix. Examples >>> x = np.array([[1, 2], [3, 4]]) >>> m = np.asmatrix(x) >>> x[0,0] = 5 >>> m matrix([[5,

numpy.mask_indices()

numpy.mask_indices(n, mask_func, k=0) [source] Return the indices to access (n, n) arrays, given a masking function. Assume mask_func is a function that, for a square array a of size (n, n) with a possible offset argument k, when called as mask_func(a, k) returns a new array with zeros in certain locations (functions like triu or tril do precisely this). Then this function returns the indices where the non-zero values would be located. Parameters: n : int The returned indices will be vali

numpy.MachAr()

class numpy.MachAr(float_conv=, int_conv=, float_to_float=, float_to_str= at 0x49c2ce2c>, title='Python floating point number') [source] Diagnosing machine parameters. Parameters: float_conv : function, optional Function that converts an integer or integer array to a float or float array. Default is float. int_conv : function, optional Function that converts a float or float array to an integer or integer array. Default is int. float_to_float : function, optional Function that conv

numpy.ma.zeros()

numpy.ma.zeros(shape, dtype=float, order='C') = Return a new array of given shape and type, filled with zeros. Parameters: shape : int or sequence of ints Shape of the new array, e.g., (2, 3) or 2. dtype : data-type, optional The desired data-type for the array, e.g., numpy.int8. Default is numpy.float64. order : {?C?, ?F?}, optional Whether to store multidimensional data in C- or Fortran-contiguous (row- or column-wise) order in memory. Returns: out : ndarray Array of zeros with

numpy.ma.where()

numpy.ma.where(condition, x=, y=) [source] Return a masked array with elements from x or y, depending on condition. Returns a masked array, shaped like condition, where the elements are from x when condition is True, and from y otherwise. If neither x nor y are given, the function returns a tuple of indices where condition is True (the result of condition.nonzero()). Parameters: condition : array_like, bool The condition to meet. For each True element, yield the corresponding element from

numpy.ma.vstack()

numpy.ma.vstack(tup) = Stack arrays in sequence vertically (row wise). Take a sequence of arrays and stack them vertically to make a single array. Rebuild arrays divided by vsplit. Parameters: tup : sequence of ndarrays Tuple containing arrays to be stacked. The arrays must have the same shape along all but the first axis. Returns: stacked : ndarray The array formed by stacking the given arrays. See also stack Join a sequence of arrays along a new axis. hstack Stack arrays i

numpy.ma.var()

numpy.ma.var(self, axis=None, dtype=None, out=None, ddof=0) = Compute the variance along the specified axis. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis. Parameters: a : array_like Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted. axis : None or int or tuple of ints, optional Axis or axes along which

numpy.ma.vander()

numpy.ma.vander(x, n=None) [source] Generate a Vandermonde matrix. The columns of the output matrix are powers of the input vector. The order of the powers is determined by the increasing boolean argument. Specifically, when increasing is False, the i-th output column is the input vector raised element-wise to the power of N - i - 1. Such a matrix with a geometric progression in each row is named for Alexandre- Theophile Vandermonde. Parameters: x : array_like 1-D input array. N : int, o