code: def mean_by_window(self, indices, window):
          
          masks = self._makewindows(indices, window)
          newindex = arange(0, len(masks[0]))
          return self.map(lambda x: mean([x[m] for m in masks], axis=0), index=newindex)
docs: Average series across multiple windows specified by their centers.
  
          Parameters
          ----------
          indices : array-like
              List of times specifying window centers
  
          window : int
              Window size