- Series.autocorr(lag=1, split_every=False)¶
Compute the lag-N autocorrelation.
This docstring was copied from pandas.core.series.Series.autocorr.
Some inconsistencies with the Dask version may exist.
This method computes the Pearson correlation between the Series and its shifted self.
- lagint, default 1
Number of lags to apply before performing autocorrelation.
The Pearson correlation between self and self.shift(lag).
If the Pearson correlation is not well defined return ‘NaN’.
>>> s = pd.Series([0.25, 0.5, 0.2, -0.05]) >>> s.autocorr() 0.10355... >>> s.autocorr(lag=2) -0.99999...
If the Pearson correlation is not well defined, then ‘NaN’ is returned.
>>> s = pd.Series([1, 0, 0, 0]) >>> s.autocorr() nan