bundles / scipy 1.17.1 / scipy / _lib / _array_api_override / array_namespace
function
scipy._lib._array_api_override:array_namespace
Signature
def array_namespace ( * arrays : Array ) → ModuleType Summary
Get the array API compatible namespace for the arrays xs.
Parameters
*arrays: sequence of array_likeArrays used to infer the common namespace.
Returns
namespace: moduleCommon namespace.
Notes
Wrapper around array_api_compat.array_namespace.
Check for the global switch
SCIPY_ARRAY_API. If disabled, just return array_api_compat.numpy namespace and skip all compliance checks.Check for known-bad array classes. The following subclasses are not supported and raise and error:
NumPy arrays which do not have a boolean or numerical dtype
scipy.sparse arrays
Coerce array-likes to NumPy arrays and check their dtype. Note that non-scalar array-likes can't be mixed with non-NumPy Array API objects; e.g.
array_namespace([1, 2])returns NumPy namespace;array_namespace(np.asarray([1, 2], [3, 4])returns NumPy namespace;array_namespace(cp.asarray([1, 2], [3, 4])raises an error.
Aliases
-
scipy.differentiate.array_namespace