numpy.broadcast_to()

numpy.broadcast_to

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

Broadcast an array to a new shape.

登录查看完整内容
Parameters:

array : array_like

The array to broadcast.

shape : tuple

The shape of the desired array.

subok : bool, optional

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