- nlcpy.broadcast_to(array, shape, subok=False)
Broadcasts an array to a new shape.
The array to broadcast.
- shapesequence of ints
The shape of the desired array.
- subokbool, optional
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.
>>> import nlcpy as vp >>> x = vp.array([1, 2, 3]) >>> vp.broadcast_to(x, (3, 3)) array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])