I am using Python library scipy to calculate Pearson's correlation for two float arrays. The returned value for coefficient is always 1.0, even if the arrays are different. For example:
[-0.65499887 2.34644428]
[-1.46049758 3.86537321]
I am calling the routine in this way:
r_row, p_value = scipy.stats.pearsonr(array1, array2)
The value of r_row
is always 1.0. What am I doing wrong?