SciPy

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

scipy.sparse.isspmatrix_dia

scipy.sparse.isspmatrix_dia(x)[source]

Is x of dia_matrix type?

Parameters:

x

object to check for being a dia matrix

Returns:

bool

True if x is a dia matrix, False otherwise

Examples

>>>
>>> from scipy.sparse import dia_matrix, isspmatrix_dia
>>> isspmatrix_dia(dia_matrix([[5]]))
True
>>>
>>> from scipy.sparse import dia_matrix, csr_matrix, isspmatrix_dia
>>> isspmatrix_dia(csr_matrix([[5]]))
False