code: def movmeanstd(ts, m):
      """
      Calculate the mean and standard deviation within a moving window passing across a time series.
  
      Parameters
      ----------
      ts: Time series to evaluate.
      m: Width of the moving window.
      """
      if m <= 1:
          raise ValueError("Query length must be longer than one")
  
      ts = ts.astype("float")
      # Add zero to the beginning of the cumsum of ts
      s = np.insert(np.cumsum(ts), 0, 0)
      # Add zero to the beginning of the cumsum of ts ** 2
      sSq = np.insert(np.cumsum(ts**2), 0, 0)
      segSum = s[m:] - s[:-m]
      segSumSq = sSq[m:] - sSq[:-m]
  
      movmean = segSum / m
      movstd = np.sqrt(segSumSq / m - (segSum / m) ** 2)
  
      return [movmean, movstd]
  
file_path: matrixprofile-ts/matrixprofile/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import numpy.fft
label_desc: Use image node_id 3 for calling a global function with example usage: movmeanstd(ts, m) and returns: list