CF Step project utilities.
Moving average¶
This simple function computes the moving average over a sliding window for a given list.
Arguments:
- inputs (list): A list of integers or floats
- w (int): The sliding window that will be used to compute moving averages
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
moving_avg(a, 2)