bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / _external / array_api_extra / _lib / _utils / _helpers / asarrays
function
scipy._external.array_api_extra._lib._utils._helpers:asarrays
Signature
def asarrays(a: Array | complex, b: Array | complex, xp: ArrayNamespace) → tuple[Array, Array]Summary
Ensure both a and b are arrays.
Extended Summary
If b is a python scalar, it is converted to the same dtype as a, and vice versa.
Behavior is not specified when mixing a Python float and an array with an integer data type; this may give float32, float64, or raise an exception. Behavior is implementation-specific.
Similarly, behavior is not specified when mixing a Python complex and an array with a real-valued data type; this may give complex64, complex128, or raise an exception. Behavior is implementation-specific.
Parameters
a, b: Array | int | float | complex | boolInput arrays or scalars. At least one must be an array.
xp: array_namespace, optionalThe standard-compatible namespace for
x. Default: infer.
Returns
: Array, ArrayThe input arrays, possibly converted to arrays if they were scalars.
See also
- mixing-arrays-with-python-scalars
Array API specification for the behavior.
Aliases
scipy.differentiate.xpx._delegation.asarrays