A sensor drops out for a few readings. Filling those gaps with the column mean would be absurd for a time series — the value at 3pm is far better guessed from 2pm and 4pm than from the whole day's average. Linear interpolation draws a straight line between the two known readings on either side of a gap and reads the missing values off it.
Task: write interpolate_missing(series) returning a new list with the interior gaps filled, each filled value rounded to 4 decimal places.
None. Everything else is a number.left and the next known value at index right, each missing position left + k becomes:None. With known values on only one side there is no line to draw, and extending the last slope outward is extrapolation — a guess of a completely different character, and not what's being asked for here.The quiet reason this matters more than it looks: imputing with a global statistic flattens exactly the local structure a time-series model is trying to learn. Interpolation preserves the shape of the trend through the gap, so the smoothed series still has the slope it should.