-
-
Save edson-github/d342370d4bbb80d22a7c4ab39cdfa74f to your computer and use it in GitHub Desktop.
Revisions
-
wiso revised this gist
Mar 20, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ import numpy as np def correlation_from_covariance(covariance): v = np.sqrt(np.diag(covariance)) outer_v = np.outer(v, v) -
wiso created this gist
Mar 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ def correlation_from_covariance(covariance): v = np.sqrt(np.diag(covariance)) outer_v = np.outer(v, v) correlation = covariance / outer_v correlation[covariance == 0] = 0 return correlation