numpy.broadcast_to(array, shape, subok=False) [source]
Broadcast an array to a new shape.
| Parameters: |
|
|---|---|
| Returns: |
|
| Raises: |
|
New in version 1.10.0.
>>> x = np.array([1, 2, 3])
>>> np.broadcast_to(x, (3, 3))
array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.broadcast_to.html