figure - apple quarterly price - caying weights call these moving window functionseven though it includes functions without fixed-length window like exponentially-weighted moving average like other statistical functionsthese also automatically exclude missing data rolling_mean is one of the simplest such functions it takes timeseries or dataframe along with window (expressed as number of periods)in [ ]close_px aapl plot(out[ ]in [ ]pd rolling_mean(close_px aapl plot(see figure - for the plot by default functions like rolling_mean require the indicated number of non-na observations this behavior can be changed to account for missing data andin particularthe fact that you will have fewer than window periods of data at the beginning of the time series (see figure - )moving window functions www it-ebooks info