broadcast_to(array, shape, subok=False)
The array to broadcast.
The shape of the desired array. A single integer i
is interpreted as (i,)
.
If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).
If the array is not compatible with the new shape according to NumPy's broadcasting rules.
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.
Broadcast an array to a new shape.
>>> x = np.array([1, 2, 3])See :
... np.broadcast_to(x, (3, 3)) array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.broadcast_shapes
numpy.lib.stride_tricks.sliding_window_view
numpy.lib.stride_tricks.as_strided
numpy.broadcast
numpy.tile
dask.array.core.broadcast_to
numpy.broadcast_arrays
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them