Back to Numerical Arrays (NumPy)
np.broadcastTo
Broadcast an array to a target shape.
Syntax
np.broadcastTo(arr, targetShape)
Description
Broadcast an array to a target shape. Returns a view of the array with the target shape. The view shares data with the original array but has zero strides for broadcast dimensions.
Parameters
| Name | Description |
|---|---|
| arr | - Array to broadcast |
| targetShape | - Target shape |
Returns
Promise<NDArray>