Python detrend time series. signal as signal t = np.