Calculating a moving average

    Solution

    Suppose your data is a noisy sine wave with some missing values:

    A different way to handle missing data is to simply ignore it, and not include it in the average. The function defined here will do that.