The problem that I am facing is how i can reject a window of 10 rows if one or many of the rows consist of an outlier while computing rolling average using python pandas?
For clarification:
df = df['speed'].rolling(10).mean()
outlier_lower_bound = 0
outlier_upper_bound = 15
df.max()
Now how do I reject/ not consider the average value of those 10 period window if it consists an outlier?
The end goal is to get the max moving average without accounting/ considering the window of 10 period if it contains an outlier Thanks in advance!