SciPy

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

scipy.sparse.csr_matrix.has_canonical_format

csr_matrix.has_canonical_format

Determine whether the matrix has sorted indices and no duplicates

Returns
  • True: if the above applies
  • False: otherwise

has_canonical_format implies has_sorted_indices, so if the latter flag is False, so will the former be; if the former is found True, the latter flag is also set.