Linear algebra helper routines and wrapper functions for handling sparse matrices and dense matrices representation.
Test whether all elements along a given axis of sparse or dense matrix :param:`X` are nonzero.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – Target matrix. |
---|
or numpy.matrix :param axis: Specified axis along which nonzero test is performed. If :param:`axis` not specified, whole matrix is considered. :type axis: int
Test whether any element along a given axis of sparse or dense matrix X is nonzero.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix :param axis: Specified axis along which nonzero test is performed. If :param:`axis` not specified, whole matrix is considered. :type axis: int
Return tuple (values, indices) of the maximum entries of matrix :param:`X` along axis :param:`axis`. Row major order.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix :param axis: Specify axis along which to operate. If not specified, whole matrix :param:`X` is considered. :type axis: int
Return tuple (values, indices) of the minimum entries of matrix :param:`X` along axis :param:`axis`. Row major order.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix :param axis: Specify axis along which to operate. If not specified, whole matrix :param:`X` is considered. :type axis: int
A fast way to calculate binomial coefficients C(n, k). It is 10 times faster than scipy.mis.comb for exact answers.
Parameters: |
|
---|
Return the number of occurrences of element :param:`s` in sparse or dense matrix X.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix :param s: the input scalar. :type s: float
Compute differences between adjacent elements of X.
Parameters: | X (numpy.matrix) – Vector for which consecutive differences are computed. |
---|
Compute dot product of matrices :param:`X` and :param:`Y`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – First input matrix. |
---|
or numpy.matrix :param Y: Second input matrix. :type Y: scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia or numpy.matrix
Compute element-wise operation of matrix :param:`X` and matrix :param:`Y`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – First input matrix. |
---|
or numpy.matrix :param Y: Second input matrix. :type Y: scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia or numpy.matrix :param op: Operation to be performed. :type op: func
Return all nonzero elements indices (linear indices) of sparse or dense matrix :param:`X`. It is Matlab notation.
Parameters: | X – Target matrix. |
---|
type X: scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia or numpy.matrix
Stack sparse or dense matrices horizontally (column wise).
Parameters: | X (sequence of scipy.sparse of format csr, csc, coo, bsr,) – Sequence of matrices with compatible shapes. |
---|
dok, lil, dia or numpy.matrix
Infinity norm of a matrix (maximum absolute row sum).
Parameters: | X (scipy.sparse.csr_matrix, scipy.sparse.csc_matrix) – Input matrix. |
---|
or numpy.matrix
Compute matrix inversion using SVD.
Parameters: | X (scipy.sparse or numpy.matrix) – The input matrix. |
---|
Compute element-wise max(x,s) assignment for sparse or dense matrix.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix :param s: the input scalar. :type s: float
Compute element-wise min(x,s) assignment for sparse or dense matrix.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix :param s: the input scalar. :type s: float
Compute element-wise multiplication of matrices :param:`X` and :param:`Y`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – First input matrix. |
---|
or numpy.matrix :param Y: Second input matrix. :type Y: scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia or numpy.matrix
Check if :param:`X` contains negative elements.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix
Compute entry-wise norms (! not induced/operator norms).
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix :param p: Order of the norm. :type p: str or float
Return list of nonzero elements from X (! data, not indices).
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix
Compute matrix power of matrix :param:`X` for power :param:`s`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – Input matrix. |
---|
or numpy.matrix :param s: Power. :type s: int
Construct matrix consisting of an m-by-n tiling of copies of X.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – The input matrix. |
---|
dia or numpy.matrix :param m,n: The number of repetitions of :param:`X` along each axis. :type m,n: int
Compute scalar element wise operation of matrix :param:`X` and scalar :param:`s`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil, dia) – The input matrix. |
---|
or numpy.matrix :param s: Input scalar. If not specified, element wise operation of input matrix is computed. :type s: float :param op: Operation to be performed. :type op: func
Return sorted elements of :param:`X` and array of corresponding sorted indices.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target vector. |
---|
dia or numpy.matrix
Compute the standard deviation along the specified :param:`axis` of matrix :param:`X`.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix :param axis: Axis along which deviation is computed. If not specified, whole matrix :param:`X` is considered. :type axis: int :param ddof: Means delta degrees of freedom. The divisor used in computation is N - :param:`ddof`, where N represents the number of elements. Default is 0. :type ddof: float
Return the linear index equivalents to the row and column subscripts for given matrix shape.
Parameters: |
|
---|
Compute standard SVD on matrix X.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – The input matrix. |
---|
dia or numpy.matrix
Return trace of sparse or dense square matrix X.
Parameters: | X (scipy.sparse of format csr, csc, coo, bsr, dok, lil,) – Target matrix. |
---|
dia or numpy.matrix
Stack sparse or dense matrices vertically (row wise).
Parameters: | X (sequence of scipy.sparse of format csr, csc, coo, bsr,) – Sequence of matrices with compatible shapes. |
---|
dok, lil, dia or numpy.matrix