I want to compute the correlation between 2 arrays. For this, I would like to use NumPy.
I used the numpy.correlate
function on a small example:
import numpy as np
a = [1, 2, 3]
b = [2, 3, 4]
np.correlate(a, b)
>>> np.array([20])
I don't really know how to interpret that result. What I would like to have is a number between -1 and 1 to indicate the correlation, with 1 meaning the arrays are positively related and -1 meaning the arrays are negatively related.
How can I get this number?