bigframes.pandas.Series.autocorr#
- Series.autocorr(lag: int = 1) float[source]#
Compute the lag-N autocorrelation.
This method computes the Pearson correlation between the Series and its shifted self.
Examples:
>>> s = bpd.Series([0.25, 0.5, 0.2, -0.05]) >>> float(s.autocorr()) 0.1035526330902...
>>> float(s.autocorr(lag=2)) -1.0
If the Pearson correlation is not well defined, then ‘NaN’ is returned.
>>> s = bpd.Series([1, 0, 0, 0]) >>> float(s.autocorr()) nan