You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/04/02 13:00:48 UTC
[GitHub] [spark] zhengruifeng edited a comment on pull request #36048: [SPARK-38774][PYTHON] Implement Series.autocorr
zhengruifeng edited a comment on pull request #36048:
URL: https://github.com/apache/spark/pull/36048#issuecomment-1086633584
check against the Pandas side:
```
In [86]: s = pd.Series([.2, .0, .6, .2, np.nan, .5, .6])
In [87]: s.autocorr()
Out[87]: -0.14121975762272054
In [88]: s.autocorr(0)
Out[88]: 1.0
In [89]: s.autocorr(2)
Out[89]: 0.9707253433941511
In [90]: s.autocorr(-3)
Out[90]: 0.2773500981126146
In [91]: s.autocorr(5)
Out[91]: -0.9999999999999998
In [92]: s.autocorr(6)
/home/zrf/.zrf/anaconda3/lib/python3.9/site-packages/numpy/lib/function_base.py:2683: RuntimeWarning: Degrees of freedom <= 0 for slice
c = cov(x, y, rowvar, dtype=dtype)
/home/zrf/.zrf/anaconda3/lib/python3.9/site-packages/numpy/lib/function_base.py:2542: RuntimeWarning: divide by zero encountered in true_divide
c *= np.true_divide(1, fact)
Out[92]: nan
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org