This is documentation for an old release of SciPy (version 1.7.1). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.sparse.isspmatrix_coo

scipy.sparse.isspmatrix_coo(x)[source]

Is x of coo_matrix type?

Parameters
x

object to check for being a coo matrix

Returns
bool

True if x is a coo matrix, False otherwise

Examples

>>> from scipy.sparse import coo_matrix, isspmatrix_coo
>>> isspmatrix_coo(coo_matrix([[5]]))
True
>>> from scipy.sparse import coo_matrix, csr_matrix, isspmatrix_coo
>>> isspmatrix_coo(csr_matrix([[5]]))
False