blosc2.prod#

blosc2.prod(ndarr: NDArray | NDField | C2Array, axis=None, dtype=None, keepdims=False, **kwargs)#

Return the product of array elements over a given axis.

Parameters:
  • ndarr (NDArray or NDField or C2Array or LazyExpr) – The input array or expression.

  • axis (int or tuple of ints, optional) – Axis or axes along which a product is performed. The default, axis=None, will multiply all the elements of the input array. If axis is negative it counts from the last to the first axis.

  • dtype (np.dtype, optional) – The type of the returned array and of the accumulator in which the elements are multiplied. The dtype of a is used by default unless a has an integer dtype of less precision than the default platform integer.

  • keepdims (bool, optional) – If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

  • kwargs (dict, optional) – Keyword arguments that are supported by the empty() constructor.

Returns:

product_along_axis – The product of the elements along the axis.

Return type:

np.ndarray or NDArray or scalar

References

np.prod