Moving average
Very often, your dataset represents real measurements over time. There's a clear trend in the data, but it's muddied by the noise in each data point. One way to focus on the trend is to perform a moving average. Each data point is the average of the n
points around it (the window).
Your task is to write a function that takes a sequence of numbers and returns a sequence of weighted averages. Make n
(the window size) an argument.