bigframes.geopandas.GeoSeries.autocorr#

GeoSeries.autocorr(lag: int = 1) float#

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
Parameters:

lag (int, default 1) – Number of lags to apply before performing autocorrelation.

Returns:

The Pearson correlation between self and self.shift(lag).

Return type:

float