zhengruifeng commented on pull request #36048:
URL: https://github.com/apache/spark/pull/36048#issuecomment-1086633584


   check against the Pandas side:
   
   ```
   In [65]: s = pd.Series([.2, .0, .6, .2, np.nan, .5, .6])
   
   In [66]: s.autocorr()
   Out[66]: -0.14121975762272054
   
   In [67]: s.autocorr(0)
   Out[67]: 1.0
   
   In [68]: s.autocorr(-3)
   Out[68]: 0.2773500981126146
   
   In [69]: s.autocorr(5)
   Out[69]: -0.9999999999999998
   
   In [70]: 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[70]: 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to