CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.
MovingAverage can be used to calculate average of the previous n (window_size) data points, just by providing the list of integers and the window size!