cudf.Series.corr#

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

Calculates the sample correlation between two Series, excluding missing values.

Parameters
otherSeries

Series with which to compute the correlation.

method{‘pearson’, ‘spearman’}, default ‘pearson’

Method used to compute correlation:

  • pearson : Standard correlation coefficient

  • spearman : Spearman rank correlation

min_periodsint, optional

Minimum number of observations needed to have a valid result.

Examples

>>> import cudf
>>> ser1 = cudf.Series([0.9, 0.13, 0.62])
>>> ser2 = cudf.Series([0.12, 0.26, 0.51])
>>> ser1.corr(ser2, method="pearson")
-0.20454263717316112
>>> ser1.corr(ser2, method="spearman")
-0.5