Reasoning about consecutive data points without using iteration
问题 I am doing SPC analysis using numpy/pandas. Part of this is checking data series against the Nelson rules and the Western Electric rules. For instance (rule 2 from the Nelson rules): Check if nine (or more) points in a row are on the same side of the mean. Now I could simply implement checking a rule like this by iterating over the array. But before I do that, I'm checking here on SO if numpy/pandas has a way to do this without iteration? In any case: What is the "numpy-ic" way to implement a