max#

bamengine.ops.max(a, axis=None)[source]#

Return maximum value of array elements.

Parameters:
  • a (array) – Input array.

  • axis (int, optional) – Axis to find maximum over. If None, find maximum over all elements.

Returns:

Maximum value (scalar if axis=None, array otherwise).

Return type:

float or array

Examples

>>> import bamengine.ops as ops
>>> prices = np.array([100, 110, 90, 105])
>>> max_price = ops.max(prices)
>>> # max_price: 110

Notes

This is an aggregation function (reduces array to single value). For element-wise maximum of two arrays, use maximum().