original_docstring:  Calculates the exponential moving average over the last axis.
  
          The result is processed in place into the array passed to the `out` parameter
  
          Parameters
          ----------
          data: :class:`numpy.ndarray`
              A 1 or 2 dimensional numpy array to obtain smoothed data for.
          out: :class:`numpy.ndarray`
              A location into which the result is stored. It must have the same shape and dtype as
              the input data
          
docstring: Calculates the exponential moving average over the last axis.
  The result is processed in place into the array passed to the `out` parameter
  
  Parameters
  
  :class:`numpy.ndarray`
  A 1 or 2 dimensional numpy array to obtain smoothed data for.
  out: :class:`numpy.ndarray`
  A location into which the result is stored. It must have the same shape and dtype as
  the input data
docstring_tokens: Calculates the exponential moving average over the last axis . The result is processed in place into the array passed to the ` out ` parameter Parameters : class : ` numpy . ndarray ` A 1 or 2 dimensional numpy array to obtain smoothed data for . out : : class : ` numpy . ndarray ` A location into which the result is stored . It must have the same shape and dtype as the input data
code: def _ewma_vectorized_2d(self, data, out):
          """ Calculates the exponential moving average over the last axis.
  
          The result is processed in place into the array passed to the `out` parameter
  
          Parameters
          ----------
          data: :class:`numpy.ndarray`
              A 1 or 2 dimensional numpy array to obtain smoothed data for.
          out: :class:`numpy.ndarray`
              A location into which the result is stored. It must have the same shape and dtype as
              the input data
          """
          if data.size < 1:  # empty input, return empty array
              return
  
          # calculate the moving average
          scaling_factors = np.power(1. - self._alpha, np.arange(data.shape[1] + 1,
                                                                 dtype=self._dtype),
                                     dtype=self._dtype)
          # create a scaled cumulative sum array
          np.multiply(data,
                      np.multiply(self._alpha * scaling_factors[-2],
                                  np.ones((data.shape[0], 1), dtype=self._dtype),
                                  dtype=self._dtype) / scaling_factors[np.newaxis, :-1],
                      dtype=self._dtype, out=out)
          np.cumsum(out, axis=1, dtype=self._dtype, out=out)
          out /= scaling_factors[np.newaxis, -2::-1]
code_tokens: def _ewma_vectorized_2d ( self , data , out ) : if data . size < 1 : return scaling_factors = np . power ( 1. - self . _alpha , np . arange ( data . shape [ 1 ] + 1 , dtype = self . _dtype ) , dtype = self . _dtype ) np . multiply ( data , np . multiply ( self . _alpha * scaling_factors [ - 2 ] , np . ones ( ( data . shape [ 0 ] , 1 ) , dtype = self . _dtype ) , dtype = self . _dtype ) / scaling_factors [ np . newaxis , : - 1 ] , dtype = self . _dtype , out = out ) np . cumsum ( out , axis = 1 , dtype = self . _dtype , out = out ) out /= scaling_factors [ np . newaxis , - 2 : : - 1 ]
short_docstring: Calculates the exponential moving average over the last axis.
short_docstring_tokens: Calculates the exponential moving average over the last axis .
comment: """ Calculates the exponential moving average over the last axis.
  
          The result is processed in place into the array passed to the `out` parameter
  
          Parameters
          ----------
          data: :class:`numpy.ndarray`
              A 1 or 2 dimensional numpy array to obtain smoothed data for.
          out: :class:`numpy.ndarray`
              A location into which the result is stored. It must have the same shape and dtype as
              the input data
          """$SEP$# empty input, return empty array$SEP$# calculate the moving average$SEP$# create a scaled cumulative sum array