skfolio.measures.mean#
- skfolio.measures.mean(returns, sample_weight=None)[source]#
- Compute the mean. - Parameters:
- returnsndarray of shape (n_observations,) or (n_observations, n_assets)
- Array of return values. 
- sample_weightndarray of shape (n_observations,), optional
- Sample weights for each observation. If None, equal weights are assumed. 
 
- Returns:
- valuefloat or ndarray of shape (n_assets,)
- The computed mean. If - returnsis a 1D-array, the result is a float. If- returnsis a 2D-array, the result is a ndarray of shape (n_assets,).
 
 - Notes - NaN handling: - Unweighted: NaNs are ignored; all-NaN inputs yield NaN. - Weighted: NaNs propagate.