(dist_a, dist_b)
return np.corrcoef(dist_a, dist_b)[0, 1]
Returns a scalar between 1.0 and -1.0. 0.0 is no correlation. 1.0 is perfect correlation
Returns a scalar between 1.0 and -1.0. 0.0 is no correlation. 1.0 is perfect correlation
Returns a scalar between 1 . 0 and - 1 . 0 . 0 . 0 is no correlation . 1 . 0 is perfect correlation
def corrcoef(dist_a, dist_b):
    """Returns a scalar between 1.0 and -1.0. 0.0 is no correlation. 1.0 is perfect correlation"""
    dist_a = np.copy(dist_a)  # Prevent np.corrcoef from blowing up on data with 0 variance
    dist_b = np.copy(dist_b)
    dist_a[0] += 1e-12
    dist_b[0] += 1e-12
    return np.corrcoef(dist_a, dist_b)[0, 1]
def corrcoef ( dist_a , dist_b ) : dist_a = np . copy ( dist_a ) # Prevent np.corrcoef from blowing up on data with 0 variance dist_b = np . copy ( dist_b ) dist_a [ 0 ] += 1e-12 dist_b [ 0 ] += 1e-12 return np . corrcoef ( dist_a , dist_b ) [ 0 , 1 ]