code: def _rolling_window(self, window_length, func1d, step=1, return_rolled=False):
          
          # Force odd.
          if window_length % 2 == 0:
              window_length += 1
  
          shape = self.shape[:-1] + (self.shape[-1], window_length)
          strides = self.strides + (step*self.strides[-1],)
          data = np.nan_to_num(self)
          data = np.pad(data, int(step*window_length//2), mode='edge')
          rolled = np.lib.stride_tricks.as_strided(data,
                                                   shape=shape,
                                                   strides=strides)
          result = np.apply_along_axis(func1d, -1, rolled)
          result[np.isnan(self)] = np.nan
  
          if return_rolled:
              return result, rolled
          else:
              return result
docs: Private function. Smoother for other smoothing/conditioning functions.
  
          Args:
              window_length (int): the window length.
              func1d (function): a function that takes a 1D array and returns a
                  scalar.
              step (int): if you want to skip samples in the shifted versions.
                  Don't use this for smoothing, you will get strange results.
  
          Returns:
              ndarray: the resulting array.