pearson

How to slice and calculate the pearson correlation coefficient between one big and small array with "overlapping" windows arrays

How to slice and calculate the pearson correlation coefficient between one big and small array with "overlapping" windows arrays Question: Suppose I have two very simple arrays with numpy: import numpy as np reference=np.array([0,1,2,3,0,0,0,7,8,9,10]) probe=np.zeros(3) I would like to find which slice of array reference has the highest pearson’s correlation coefficient with array probe. To …

Total answers: 1

ValueError: shape mismatch: objects cannot be broadcast to a single shape

ValueError: shape mismatch: objects cannot be broadcast to a single shape Question: I am using the SciPy’s pearsonr(x,y) method and I cannot figure out why the following error is happening: ValueError: shape mismatch: objects cannot be broadcast to a single shape It computes the first two (I am running several thousand of these tests in …

Total answers: 1