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:
shapeShape of the matrix
Methods
__mul__(other)asfptype()Upcast array to a floating point format (if necessary)
getH()Return the Hermitian transpose of this array.
Get the shape of the matrix
getcol(j)Returns a copy of column j of the array, as an (m x 1) sparse array (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 array, as a (1 x n) sparse array (row vector).
set_shape(shape)Set the shape of the matrix in-place