bigframes.geopandas.GeoSeries.corr#

GeoSeries.corr(other: Series, method='pearson', min_periods=None) float#

Compute the correlation with the other Series. Non-number values are ignored in the computation.

Uses the “Pearson” method of correlation. Numbers are converted to float before calculation, so the result may be unstable.

Examples:

>>> s1 = bpd.Series([.2, .0, .6, .2])
>>> s2 = bpd.Series([.3, .6, .0, .1])
>>> s1.corr(s2)
np.float64(-0.8510644963469901)
>>> s1 = bpd.Series([1, 2, 3], index=[0, 1, 2])
>>> s2 = bpd.Series([1, 2, 3], index=[2, 1, 0])
>>> s1.corr(s2)
np.float64(-1.0)
Parameters:
  • other (Series) – The series with which this is to be correlated.

  • method (string, default "pearson") – Correlation method to use - currently only “pearson” is supported.

  • min_periods (int, default None) – The minimum number of observations needed to return a result. Non-default values are not yet supported, so a result will be returned for at least two observations.

Returns:

Will return NaN if there are fewer than two numeric pairs, either series has a variance or covariance of zero, or any input value is infinite.

Return type:

float