fields.buffers.core.HDF5Buffer.broadcast_to#
- HDF5Buffer.broadcast_to(shape: Any, *args, inplace: bool = False, **kwargs) BufferBase [source]#
Broadcast an array to a new shape.
- Parameters:
shape (
tuple
orint
) – The shape of the desired output array. A single integeri
is interpreted as(i,)
.*args – Additional positional arguments forwarded to
from_array()
.inplace (
bool
, optional) – If True, values for file, name, and overwrite are ignored; the dataset underlying the calling buffer is directly replaced and the object is updated and returned in-place.**kwargs – Additional keyword arguments forwarded to and
from_array()
. If inplace isTrue
, then these are forwarded toreplace_dataset()
.
- Returns:
broadcast – 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.
- Return type:
BufferBase
- Raises:
ValueError – If the array is not compatible with the new shape according to NumPy’s broadcasting rules.