code: def detrend(self, type='linear'):
          
          from scipy.signal import detrend
          return self._return(detrend(self.numpy(), type=type))
docs: Remove linear trend from the data
  
          Remove a linear trend from the data to improve the approximation that
          the data is circularly convolved, this helps reduce the size of filter
          transients from a circular convolution / filter.
  
          Parameters
          ----------
          type: str
              The choice of detrending. The default ('linear') removes a linear
          least squares fit. 'constant' removes only the mean of the data.