A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.issparse.html below:

issparse — SciPy v1.16.1 Manual

scipy.sparse.

issparse#
scipy.sparse.issparse(x)[source]#

Is x of a sparse array or sparse matrix type?

Parameters:
x

object to check for being a sparse array or sparse matrix

Returns:
bool

True if x is a sparse array or a sparse matrix, False otherwise

Notes

Use isinstance(x, sp.sparse.sparray) to check between an array or matrix. Use a.format to check the sparse format, e.g. a.format == ‘csr’.

Examples

>>> import numpy as np
>>> from scipy.sparse import csr_array, csr_matrix, issparse
>>> issparse(csr_matrix([[5]]))
True
>>> issparse(csr_array([[5]]))
True
>>> issparse(np.array([[5]]))
False
>>> issparse(5)
False

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4