numpy.may_share_memory()

numpy.may_share_memory(a, b, max_work=None) Determine if two arrays might share memory A return of True does not necessarily mean that the two arrays share any element. It just means that they might. Only the memory bounds of a and b are checked by default. Parameters: a, b : ndarray Input arrays max_work : int, optional Effort to spend on solving the overlap problem. See shares_memory for details. Default for may_share_memory is to do a bounds check. Returns: out : bool See also s

numpy.maximum()

numpy.maximum(x1, x2[, out]) = Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated. Parameters: x1, x2 : array_like T

numpy.matrix

class numpy.matrix [source] Returns a matrix from an array-like object, or from a string of data. A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as * (matrix multiplication) and ** (matrix power). Parameters: data : array_like or string If data is a string, it is interpreted as a matrix with commas or spaces separating columns, and semicolons separating rows. dtype : data-type Data-type of the output matrix. co

numpy.matmul()

numpy.matmul(a, b, out=None) Matrix product of two arrays. The behavior depends on the arguments in the following way. If both arguments are 2-D they are multiplied like conventional matrices. If either argument is N-D, N > 2, it is treated as a stack of matrices residing in the last two indexes and broadcast accordingly. If the first argument is 1-D, it is promoted to a matrix by prepending a 1 to its dimensions. After matrix multiplication the prepended 1 is removed. If the second argu

numpy.matlib.zeros()

numpy.matlib.zeros(shape, dtype=None, order='C') [source] Return a matrix of given shape and type, filled with zeros. Parameters: shape : int or sequence of ints Shape of the matrix dtype : data-type, optional The desired data-type for the matrix, default is float. order : {?C?, ?F?}, optional Whether to store the result in C- or Fortran-contiguous order, default is ?C?. Returns: out : matrix Zero matrix of given shape, dtype, and order. See also numpy.zeros Equivalent array

numpy.matlib.repmat()

numpy.matlib.repmat(a, m, n) [source] Repeat a 0-D to 2-D array or matrix MxN times. Parameters: a : array_like The array or matrix to be repeated. m, n : int The number of times a is repeated along the first and second axes. Returns: out : ndarray The result of repeating a. Examples >>> import numpy.matlib >>> a0 = np.array(1) >>> np.matlib.repmat(a0, 2, 3) array([[1, 1, 1], [1, 1, 1]]) >>> a1 = np.arange(4) >>> np.matlib.repma

numpy.matlib.randn()

numpy.matlib.randn(*args) [source] Return a random matrix with data from the ?standard normal? distribution. randn generates a matrix filled with random floats sampled from a univariate ?normal? (Gaussian) distribution of mean 0 and variance 1. Parameters: *args : Arguments Shape of the output. If given as N integers, each integer specifies the size of one dimension. If given as a tuple, this tuple gives the complete shape. Returns: Z : matrix of floats A matrix of floating-point samp

numpy.matlib.rand()

numpy.matlib.rand(*args) [source] Return a matrix of random values with given shape. Create a matrix of the given shape and propagate it with random samples from a uniform distribution over [0, 1). Parameters: *args : Arguments Shape of the output. If given as N integers, each integer specifies the size of one dimension. If given as a tuple, this tuple gives the complete shape. Returns: out : ndarray The matrix of random values with shape given by *args. See also randn, numpy.rando

numpy.matlib.ones()

numpy.matlib.ones(shape, dtype=None, order='C') [source] Matrix of ones. Return a matrix of given shape and type, filled with ones. Parameters: shape : {sequence of ints, int} Shape of the matrix dtype : data-type, optional The desired data-type for the matrix, default is np.float64. order : {?C?, ?F?}, optional Whether to store matrix in C- or Fortran-contiguous order, default is ?C?. Returns: out : matrix Matrix of ones of given shape, dtype, and order. See also ones Array

numpy.matlib.identity()

numpy.matlib.identity(n, dtype=None) [source] Returns the square identity matrix of given size. Parameters: n : int Size of the returned identity matrix. dtype : data-type, optional Data-type of the output. Defaults to float. Returns: out : matrix n x n matrix with its main diagonal set to one, and all other elements zero. See also numpy.identity Equivalent array function. matlib.eye More general matrix identity function. Examples >>> import numpy.matlib >>&g