pastas.stats.core.mean ====================== .. py:function:: pastas.stats.core.mean(series: pandas.Series | None = None, weighted: bool = True, max_gap: int = 30, **kwargs) -> pastas.typing.ArrayLike Compute the (weighted) mean of a time series. :param series: Series with the values and a DatetimeIndex as an index. :type series: pandas.Series :param weighted: Weight the values by the normalized time step to account for irregular time series. Default is True. :type weighted: bool, optional :param max_gap: maximum allowed gap period in days to use for the computation of the weights. All time steps larger than max_gap are replace with the mean weight. Default value is 90 days. :type max_gap: int, optional .. rubric:: Notes The (weighted) mean for a time series x is computed as: .. math:: \\bar{x} = \\sum_{i=1}^{N} w_i x_i where :math:`w_i` are the weights, taken as the time step between observations, normalized by the sum of all time steps. .. !! processed by numpydoc !!