code: def _smooth(series, window_len, window):
      
  
      windows = {
          "flat": np.ones,
          "hanning": np.hanning,
          "hamming": np.hamming,
          "bartlett": np.bartlett,
          "blackman": np.blackman,
      }
      data = series.values.copy()
  
      if window_len < 3:
          return pd.Series(data, index=series.index, name=series.name)
  
      if window not in list(windows.keys()):
          raise ValueError(
              """window must be one of 'flat', 'hanning',
                           'hamming', 'bartlett', 'blackman'"""
          )
  
      s = np.r_[
          2 * data[0] - data[window_len:1:-1],
          data,
          2 * data[-1] - data[-1:-window_len:-1],
      ]
  
      w = windows[window](window_len)
  
      data = np.convolve(w / w.sum(), s, mode="same")
      data = data[window_len - 1 : -window_len + 1]
      return pd.Series(data, index=series.index, name=series.name)
docs: Smooth the data using a window with requested size.