pandas.Series.corr

pandas 3.1.1 · Series and accessors · method

Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.

Call syntax

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

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
other Required
Positional or keyword
Series

Supply the second object or value used in the operation.

method Optional
Positional or keyword
Default 'pearson'
{'pearson', 'kendall', 'spearman'} or callable

Choose the algorithm used to calculate, align, or fill the result.

min_periods Optional
Positional or keyword
Default None
int

Require this many valid observations in a window before pandas reports a value.

Returns

float