diff --git a/pymannkendall/pymannkendall.py b/pymannkendall/pymannkendall.py index e5eeb39..ab04ed1 100644 --- a/pymannkendall/pymannkendall.py +++ b/pymannkendall/pymannkendall.py @@ -57,7 +57,10 @@ def __acf(x, nlags): acov = (np.correlate(y, y, 'full') / d)[n - 1:] - return acov[:nlags+1]/acov[0] + if acov[0] != 0 : + return acov[:nlags+1]/acov[0] + else : + return acov[:nlags+1] # vectorization approach to calculate mk score, S