package scipy
Module Linalg.InterfaceSource
Get an attribute of this module as a Py.Object.t. This is useful to pass a Python function to another function.
Return A as a LinearOperator.
'A' may be any of the following types:
- ndarray
- matrix
- sparse matrix (e.g. csr_matrix, lil_matrix, etc.)
- LinearOperator
- An object with .shape and .matvec attributes
See the LinearOperator documentation for additional information.
Notes ----- If 'A' has no .dtype attribute, the data type is determined by calling :func:`LinearOperator.matvec()` - set the .dtype attribute to prevent this call upon the linear operator creation.
Examples -------- >>> from scipy.sparse.linalg import aslinearoperator >>> M = np.array([1,2,3],[4,5,6], dtype=np.int32) >>> aslinearoperator(M) <2x3 MatrixLinearOperator with dtype=int32>
None
Check whether object is pydata/sparse matrix, avoiding importing the module.
Is x appropriate as an index into a sparse matrix? Returns True if it can be cast safely to a machine int.
Is x a valid 2-tuple of dimensions?
If nonneg, also checks that the dimensions are non-negative.
Is x of a sparse matrix type?
Parameters ---------- x object to check for being a sparse matrix
Returns ------- bool True if x is a sparse matrix, False otherwise
Notes ----- issparse and isspmatrix are aliases for the same function.
Examples -------- >>> from scipy.sparse import csr_matrix, isspmatrix >>> isspmatrix(csr_matrix([5])) True
>>> from scipy.sparse import isspmatrix >>> isspmatrix(5) False