bundles / scipy 1.17.1 / scipy / _lib / array_api_extra / _lib / _utils / _helpers / asarrays
function
scipy._lib.array_api_extra._lib._utils._helpers:asarrays
source: /scipy/_lib/array_api_extra/_lib/_utils/_helpers.py :156
Signature
def asarrays ( a : Array | complex , b : Array | complex , xp : ModuleType ) → 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