docstr: Calculate an online exponentially weighted mean.
  
  Parameters
  ----------
  update: DataFrame or Series, default None
      New values to continue calculating the
      exponentially weighted mean from the last values and weights.
      Values should be float64 dtype.
  
      ``update`` needs to be ``None`` the first time the
      exponentially weighted mean is calculated.
  
  update_times: Series or 1-D np.ndarray, default None
      New times to continue calculating the
      exponentially weighted mean from the last values and weights.
      If ``None``, values are assumed to be evenly spaced
      in time.
      This feature is currently unsupported.
  
  Returns
  -------
  DataFrame or Series
  
  Examples
  --------
  >>> df = pd.DataFrame({"a": range(5), "b": range(5, 10)})
  >>> online_ewm = df.head(2).ewm(0.5).online()
  >>> online_ewm.mean()
        a     b
  0  0.00  5.00
  1  0.75  5.75
  >>> online_ewm.mean(update=df.tail(3))
            a         b
  2  1.615385  6.615385
  3  2.550000  7.550000
  4  3.520661  8.520661
  >>> online_ewm.reset()
  >>> online_ewm.mean()
        a     b
  0  0.00  5.00
  1  0.75  5.75
docstr_tok: ["Calculate","an","online","exponentially","weighted","mean",".","Parameters","--","--","--","--","--","update",":","DataFrame","or","Series",",","default","None","New","values","to","continue","calculating","the","exponentially","weighted","mean","from","the","last","values","and","weights",".","Values","should","be","float64","dtype",".","``","update","``","needs","to","be","``","None","``","the","first","time","the","exponentially","weighted","mean","is","calculated",".","update_times",":","Series","or","1-D","np.ndarray",",","default","None","New","times","to","continue","calculating","the","exponentially","weighted","mean","from","the","last","values","and","weights",".","If","``","None","``",",","values","are","assumed","to","be","evenly","spaced","in","time",".","This","feature","is","currently","unsupported",".","Returns","--","--","--","-","DataFrame","or","Series","Examples","--","--","--","--",">",">",">","df","=","pd.DataFrame","(","{","``","a","''",":","range","(","5",")",",","``","b","''",":","range","(","5",",","10",")","}",")",">",">",">","online_ewm","=","df.head","(","2",")",".ewm","(","0.5",")",".online","(",")",">",">",">","online_ewm.mean","(",")","a","b","0","0.00","5.00","1","0.75","5.75",">",">",">","online_ewm.mean","(","update=df.tail","(","3",")",")","a","b","2","1.615385","6.615385","3","2.550000","7.550000","4","3.520661","8.520661",">",">",">","online_ewm.reset","(",")",">",">",">","online_ewm.mean","(",")","a","b","0","0.00","5.00","1","0.75","5.75"]
code: def mean(self, *args, update=None, update_times=None, **kwargs):
      """
      Calculate an online exponentially weighted mean.
  
      Parameters
      ----------
      update: DataFrame or Series, default None
          New values to continue calculating the
          exponentially weighted mean from the last values and weights.
          Values should be float64 dtype.
  
          ``update`` needs to be ``None`` the first time the
          exponentially weighted mean is calculated.
  
      update_times: Series or 1-D np.ndarray, default None
          New times to continue calculating the
          exponentially weighted mean from the last values and weights.
          If ``None``, values are assumed to be evenly spaced
          in time.
          This feature is currently unsupported.
  
      Returns
      -------
      DataFrame or Series
  
      Examples
      --------
      >>> df = pd.DataFrame({"a": range(5), "b": range(5, 10)})
      >>> online_ewm = df.head(2).ewm(0.5).online()
      >>> online_ewm.mean()
            a     b
      0  0.00  5.00
      1  0.75  5.75
      >>> online_ewm.mean(update=df.tail(3))
                a         b
      2  1.615385  6.615385
      3  2.550000  7.550000
      4  3.520661  8.520661
      >>> online_ewm.reset()
      >>> online_ewm.mean()
            a     b
      0  0.00  5.00
      1  0.75  5.75
      """
      result_kwargs = {}
      is_frame = self._selected_obj.ndim == 2
      if update_times is not None:
          raise NotImplementedError("update_times is not implemented.")
      update_deltas = np.ones(
          max(self._selected_obj.shape[self.axis - 1] - 1, 0),
          dtype=np.float64,
      )
      if update is not None:
          if self._mean.last_ewm is None:
              raise ValueError(
                  "Must call mean with update=None first before passing update"
              )
          result_from = 1
          result_kwargs["index"] = update.index
          if is_frame:
              last_value = self._mean.last_ewm[np.newaxis, :]
              result_kwargs["columns"] = update.columns
          else:
              last_value = self._mean.last_ewm
              result_kwargs["name"] = update.name
          np_array = np.concatenate((last_value, update.to_numpy()))
      else:
          result_from = 0
          result_kwargs["index"] = self._selected_obj.index
          if is_frame:
              result_kwargs["columns"] = self._selected_obj.columns
          else:
              result_kwargs["name"] = self._selected_obj.name
          np_array = self._selected_obj.astype(
              np.float64, copy=False
          ).to_numpy()
      ewma_func = generate_online_numba_ewma_func(
          **get_jit_arguments(self.engine_kwargs)
      )
      result = self._mean.run_ewm(
          np_array if is_frame else np_array[:, np.newaxis],
          update_deltas,
          self.min_periods,
          ewma_func,
      )
      if not is_frame:
          result = result.squeeze()
      result = result[result_from:]
      result = self._selected_obj._constructor(result, **result_kwargs)
      return result
  
imports: from __future__ import annotations
  import datetime
  from functools import partial
  from textwrap import dedent
  from typing import TYPE_CHECKING
  import numpy
  from pandas._libs.tslibs import Timedelta
  import pandas._libs.window.aggregations
  from pandas.util._decorators import doc
  from pandas.core.dtypes.common import is_datetime64_dtype, is_numeric_dtype
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.dtypes.missing import isna
  from pandas.core import common
  from pandas.core.arrays.datetimelike import dtype_to_unit
  from pandas.core.indexers.objects import BaseIndexer, ExponentialMovingWindowIndexer, GroupbyIndexer
  from pandas.core.util.numba_ import get_jit_arguments, maybe_use_numba
  from pandas.core.window.common import zsqrt
  from pandas.core.window.doc import _shared_docs, create_section_header, kwargs_numeric_only, numba_notes, template_header, template_returns, template_see_also, window_agg_numba_parameters
  from pandas.core.window.numba_ import generate_numba_ewm_func, generate_numba_ewm_table_func
  from pandas.core.window.online import EWMMeanState, generate_online_numba_ewma_func
  from pandas.core.window.rolling import BaseWindow, BaseWindowGroupby
label_desc: Use image node_id 8 for calling the OnlineExponentialMovingWindow obj's underlying member method code with example usage: obj.mean() and returns: result