Broadcast an array to a new shape.
Parameters: | array : array_like
shape : tuple
subok : bool, optional
|
---|---|
Returns: | broadcast : array
|
Raises: | ValueError
|
Examples
>>> x = np.array([1, 2, 3])
>>> np.broadcast_to(x, (3, 3))
array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])