A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.scipy.org/doc/numpy/reference/generated/numpy.broadcast_to.html below:

numpy.broadcast_to — NumPy v2.3 Manual

numpy.broadcast_to#
numpy.broadcast_to(array, shape, subok=False)[source]#

Broadcast an array to a new shape.

Parameters:
arrayarray_like

The array to broadcast.

shapetuple or int

The shape of the desired array. A single integer i is interpreted as (i,).

subokbool, optional

If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).

Returns:
broadcastarray

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.

Raises:
ValueError

If the array is not compatible with the new shape according to NumPy’s broadcasting rules.

Examples

>>> import numpy as np
>>> x = np.array([1, 2, 3])
>>> np.broadcast_to(x, (3, 3))
array([[1, 2, 3],
       [1, 2, 3],
       [1, 2, 3]])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4