fields.buffers.core.ArrayBuffer.squeeze#

ArrayBuffer.squeeze(*args, axis=None, **kwargs) BufferBase#

Remove axes of length one from self.

Parameters:
  • axis (None or int or tuple of ints, optional) – Selects a subset of the entries of length one in the shape. If an axis is selected with shape entry greater than one, an error is raised.

  • *args – Additional positional arguments forwarded to from_array.

  • **kwargs – Additional keyword arguments forwarded to from_array.

Returns:

The input buffer, but with all or a subset of the dimensions of length 1 removed. This is always self itself or a view into self. Note that if all axes are squeezed, the result is a 0d array and not a scalar.

Return type:

BufferBase