We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0371ce commit d63760aCopy full SHA for d63760a
pandas/core/frame.py
@@ -11233,6 +11233,9 @@ def corr(
11233
f"'{method}' was supplied"
11234
)
11235
11236
+ # clip coefficient to ensure it is within theoretical bounds
11237
+ correl = np.clip(correl, -1, 1)
11238
+
11239
result = self._constructor(correl, index=idx, columns=cols, copy=False)
11240
return result.__finalize__(self, method="corr")
11241
0 commit comments