Moving Average Computation

Easy Python DSP
Solve this problem

Compute the moving average of a list of values in Python. The function returns a list of averages for the given window size.

Constraints

  • Input: list of ints/floats.
  • Window N.
  • Use cumulative sum or direct averaging.
  • Return same length as input.
Starter codePython
1def movavg(x,N):2    pass