{ } Raw JSON

bundles / scipy 1.18.0 / scipy / _external / array_api_compat / common / _helpers / is_pydata_sparse_array

function

scipy._external.array_api_compat.common._helpers:is_pydata_sparse_array

source: /scipy/_external/array_api_compat/common/_helpers.py:251

Signature

def is_pydata_sparse_array(x: object) → TypeIs[sparse.SparseArray]

Summary

Return True if x is an array from the sparse package.

Extended Summary

This function does not import sparse if it has not already been imported and is therefore cheap to use.

See also

array_namespace
is_array_api_obj
is_cupy_array
is_dask_array
is_jax_array
is_ndonnx_array
is_numpy_array
is_torch_array

Aliases

  • scipy.sparse.linalg._interface.is_pydata_sparse_array