scipy.sparse.spmatrix#
- class scipy.sparse.spmatrix[source]#
This class provides a base class for all sparse matrix classes.
It cannot be instantiated. Most of the work is provided by subclasses.
- Attributes:
shape
Shape of the matrix
Methods
__mul__
(other)asfptype
()Upcast matrix to a floating point format (if necessary)
getH
()Return the Hermitian transpose of this matrix.
Get the shape of the matrix
getcol
(j)Returns a copy of column j of the matrix, as an (m x 1) sparse matrix (column vector).
Matrix storage format
Maximum number of elements to display when printed.
getnnz
([axis])Number of stored values, including explicit zeros.
getrow
(i)Returns a copy of row i of the matrix, as a (1 x n) sparse matrix (row vector).
set_shape
(shape)Set the shape of the matrix in-place