I have wrote the following code:
from scipy.interpolate import interp1d from scipy.signal import medfilt z = medfilt(derivation,3) diff = abs(derivation-z) #s