Pandas Series: autocorr() function

Compute the lag-N autocorrelation in Pandas

The autocorr() function is used to compute the lag-N autocorrelation.

This method computes the Pearson correlation between the Series and its shifted self.


Series.autocorr(self, lag=1)
Pandas Series: autocorr() function


Name Description Type/Default Value Required / Optional
lag Number of lags to apply before performing autocorrelation. int
Default Value: 1

Returns: float
The Pearson correlation between self and self.shift(lag)

Notes: If the Pearson correlation is not well defined return ‘NaN’.


Download the above Notebook from here.

Previous: Test whether all element is true over requested Pandas axis
Next: Boolean Series in Pandas