broadcast_arrays

Contents

broadcast_arrays#

class saiunit.math.broadcast_arrays(*args, **kwargs)#

Broadcast any number of arrays against each other.

Parameters:

*args (array_likes) – The arrays to broadcast.

Returns:

broadcasted – These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first. While you can set the writable flag True, writing to a single output value may end up changing more than one location in the output array.

Return type:

saiunit.Quantity | Array | Sequence[saiunit.Quantity | Array]

Examples

>>> import saiunit as u
>>> a = [1, 2, 3] * u.second
>>> b = [[4], [5]] * u.second
>>> u.math.broadcast_arrays(a, b)