class_docstr: Base class for factors implementing exponential-weighted operations.
  
  **Default Inputs:** None
  
  **Default Window Length:** None
  
  Parameters
  ----------
  inputs : length-1 list or tuple of BoundColumn
      The expression over which to compute the average.
  window_length : int > 0
      Length of the lookback window over which to compute the average.
  decay_rate : float, 0 < decay_rate <= 1
      Weighting factor by which to discount past observations.
  
      When calculating historical averages, rows are multiplied by the
      sequence::
  
          decay_rate, decay_rate ** 2, decay_rate ** 3, ...
  
  Methods
  -------
  weights
  from_span
  from_halflife
  from_center_of_mass
class_docstr_tok: ["Base","class","for","factors","implementing","exponential-weighted","operations",".","*","*","Default","Inputs",":","*","*","None","*","*","Default","Window","Length",":","*","*","None","Parameters","--","--","--","--","--","inputs",":","length-1","list","or","tuple","of","BoundColumn","The","expression","over","which","to","compute","the","average",".","window_length",":","int",">","0","Length","of","the","lookback","window","over","which","to","compute","the","average",".","decay_rate",":","float",",","0","<","decay_rate","<","=","1","Weighting","factor","by","which","to","discount","past","observations",".","When","calculating","historical","averages",",","rows","are","multiplied","by","the","sequence",":",":","decay_rate",",","decay_rate","*","*","2",",","decay_rate","*","*","3",",","...","Methods","--","--","--","-","weights","from_span","from_halflife","from_center_of_mass"]
docstr: Convenience constructor for passing `decay_rate` in terms of center of
  mass.
  
  Forwards `decay_rate` as `1 - (1 / 1 + center_of_mass)`.  This provides
  behavior equivalent to passing `center_of_mass` to pandas.ewma.
  
  Examples
  --------
  .. code-block:: python
  
      # Equivalent to:
      # my_ewma = EWMA(
      #    inputs=[EquityPricing.close],
      #    window_length=30,
      #    decay_rate=(1 - (1 / 15.0)),
      # )
      my_ewma = EWMA.from_center_of_mass(
          inputs=[EquityPricing.close],
          window_length=30,
          center_of_mass=15,
      )
  
  Notes
  -----
  This classmethod is provided by both
  :class:`ExponentialWeightedMovingAverage` and
  :class:`ExponentialWeightedMovingStdDev`.
code: def from_center_of_mass(
      cls, inputs, window_length, center_of_mass, **kwargs
  ):
      """
      Convenience constructor for passing `decay_rate` in terms of center of
      mass.
  
      Forwards `decay_rate` as `1 - (1 / 1 + center_of_mass)`.  This provides
      behavior equivalent to passing `center_of_mass` to pandas.ewma.
  
      Examples
      --------
      .. code-block:: python
  
          # Equivalent to:
          # my_ewma = EWMA(
          #    inputs=[EquityPricing.close],
          #    window_length=30,
          #    decay_rate=(1 - (1 / 15.0)),
          # )
          my_ewma = EWMA.from_center_of_mass(
              inputs=[EquityPricing.close],
              window_length=30,
              center_of_mass=15,
          )
  
      Notes
      -----
      This classmethod is provided by both
      :class:`ExponentialWeightedMovingAverage` and
      :class:`ExponentialWeightedMovingStdDev`.
      """
      return cls(
          inputs=inputs,
          window_length=window_length,
          decay_rate=(1.0 - (1.0 / (1.0 + center_of_mass))),
          **kwargs,
      )
  
imports: from numbers import Number
  from numpy import arange, average, clip, copyto, exp, fmax, full, isnan, log, NINF, sqrt, sum, unique
  from zipline.pipeline.data import EquityPricing
  from zipline.utils.input_validation import expect_types
  from zipline.utils.math_utils import nanargmax, nanmax, nanmean, nanstd, nansum
  from zipline.utils.numpy_utils import float64_dtype, ignore_nanwarnings
  from .factor import CustomFactor
  from ..mixins import SingleInputMixin
label_desc: Use image node_id 3 for calling the _ExponentialWeightedFactor obj's underlying member method code with example usage: obj.from_center_of_mass(cls, inputs, window_length, center_of_mass) and returns: cls