Compute the lag-N autocorrelation.
This method computes the Pearson correlation between
the Series and its shifted self.
Number of lags to apply before performing autocorrelation.
The Pearson correlation between self and self.shift(lag).
Compute the correlation between two Series.
Shift index by desired number of periods.
Compute pairwise correlation of columns.
Compute pairwise correlation between rows or columns of two DataFrame objects.
If the Pearson correlation is not well defined return ‘NaN’.
>>> s = pd.Series([0.25, 0.5, 0.2, -0.05])
If the Pearson correlation is not well defined, then ‘NaN’ is returned.
>>> s = pd.Series([1, 0, 0, 0])