pandas 1.4.2

ParametersReturnsBackRef
corr(self, other, method='pearson', min_periods=None) -> 'float'

Parameters

other : Series

Series with which to compute the correlation.

method : {'pearson', 'kendall', 'spearman'} or callable

Method used to compute correlation:

min_periods : int, optional

Minimum number of observations needed to have a valid result.

Returns

float

Correlation with other.

Compute correlation with other Series, excluding missing values.

See Also

DataFrame.corr

Compute pairwise correlation between columns.

DataFrame.corrwith

Compute pairwise correlation with another DataFrame or Series.

Examples

This example is valid syntax, but we were not able to check execution
>>> def histogram_intersection(a, b):
...  v = np.minimum(a, b).sum().round(decimals=1)
...  return v
... s1 = pd.Series([.2, .0, .6, .2])
... s2 = pd.Series([.3, .6, .0, .1])
... s1.corr(s2, method=histogram_intersection) 0.3
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.window.expanding.Expanding.corr pandas.core.window.rolling.Rolling.corr pandas.core.frame.DataFrame.corr pandas.core.series.Series.autocorr pandas.core.window.ewm.ExponentialMovingWindow.corr

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/series.py#2508
type: <class 'function'>
Commit: