mean#
- bamengine.ops.mean(a, axis=None, where=None)[source]#
Calculate mean, optionally over axis or subset.
- Parameters:
- Returns:
Mean value (scalar if axis=None, array otherwise).
- Return type:
Examples
>>> import bamengine.ops as ops >>> prices = np.array([100, 110, 90, 0]) >>> # Average price of active firms (price > 0) >>> active = prices > 0 >>> avg_price = ops.mean(prices, where=active) >>> # avg_price: 100