def moving_average(data, window_size=10):
    h = int((window_size / 2))
    x_max = len(data)
    return [np.mean(data[max(0, (x - h)):min(x_max, (x + h))]) for x in range(0, x_max)]
def moving_average(data, window_size=10):
    h = int((window_size / 2))
    x_max = len(data)
    return [np.mean(data[max(0, (x - h)):min(x_max, (x + h))]) for x in range(0, x_max)]