Skip to content

Commit a703313

Browse files
fbnrstjreback
authored andcommitted
DOC: clarify corr behaviour when using a callable (#25732)
fixes #25726
1 parent 26c0924 commit a703313

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pandas/core/frame.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7021,8 +7021,9 @@ def corr(self, method='pearson', min_periods=1):
70217021
* kendall : Kendall Tau correlation coefficient
70227022
* spearman : Spearman rank correlation
70237023
* callable: callable with input two 1d ndarrays
7024-
and returning a float
7025-
7024+
and returning a float. Note that the returned matrix from corr
7025+
will have 1 along the diagonals and will be symmetric
7026+
regardless of the callable's behavior
70267027
.. versionadded:: 0.24.0
70277028
70287029
min_periods : int, optional

pandas/core/series.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2128,8 +2128,10 @@ def corr(self, other, method='pearson', min_periods=None):
21282128
* pearson : standard correlation coefficient
21292129
* kendall : Kendall Tau correlation coefficient
21302130
* spearman : Spearman rank correlation
2131-
* callable: callable with input two 1d ndarray
2132-
and returning a float
2131+
* callable: callable with input two 1d ndarrays
2132+
and returning a float. Note that the returned matrix from corr
2133+
will have 1 along the diagonals and will be symmetric
2134+
regardless of the callable's behavior
21332135
.. versionadded:: 0.24.0
21342136
21352137
min_periods : int, optional

0 commit comments

Comments
 (0)