std#

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

Calculate standard deviation, optionally over axis or subset.

Parameters:
  • a (array) – Input array.

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

  • where (bool array, optional) – Mask for subset.

Returns:

Standard deviation (scalar if axis=None, array otherwise).

Return type:

float or array

Examples

>>> import bamengine.ops as ops
>>> prices = np.array([100, 110, 90, 100])
>>> price_std = ops.std(prices)
>>> # price_std: ~7.07