A moving average smooths a noisy series by replacing each point with the mean of the window values ending there. It's the first tool anyone reaches for in time-series work, and the basis of half the features you'd engineer from a sequence.
Task: write moving_average(series, window) returning a list of floats rounded to 4 decimal places.
Only full windows count. With 5 values and a window of 3 you get 3 averages, not 5 — the first two positions don't have enough history behind them.
window is larger than the series, return an empty list.1 returns the series unchanged.