fields.buffers.core.HDF5Buffer.reshape#

HDF5Buffer.reshape(shape, *args, inplace: bool = False, **kwargs) BufferBase[source]#

Return a reshaped copy of this buffer.

This reshapes the buffer into a new shape and returns a new buffer instance. The reshaping is done using the NumPy-compatible view returned by as_repr().

Parameters:
  • shape (tuple of int) – Target shape for the new buffer.

  • *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 is True, then these are forwarded to replace_dataset().

Returns:

A new buffer with reshaped data.

Return type:

BufferBase