I have a problem like in the picture.
I figured out that I would do this with a moving average, but as you know the average leaves an unnecessary deviation and I need exact data, not average data. This is not an acceptable solution.
import bottleneck as bn
df['mT_Dok2'] = bn.move_mean(df['mT_Dok'], window=20, min_count=1)
df['mT_Dok'].plot(linewidth=0.9)
df['mT_Dok2'].plot(linewidth=0.9)
It doesn't work for me, I don't know what to do
df['mT_Dok2'] = df['mT_Dok'].apply(lambda x: x if x > (3*np.std(x)) else np.nan)
the necessary tools to eliminate such jumps as will appear in the time series. I am asking for help, colleagues ....




