broadcast_to#
- class saiunit.math.broadcast_to(array, shape, **kwargs)#
Broadcast an array to a new shape.
- Parameters:
- Returns:
broadcast – A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.
- Return type:
saiunit.Quantity |
Array- Raises:
ValueError – If the array is not compatible with the new shape according to NumPy’s broadcasting rules.
Examples
>>> import saiunit as u >>> a = [1, 2, 3] * u.meter >>> u.math.broadcast_to(a, (2, 3))