I want to compute the correlation between two sequences X and Y, and
tried using SciPy to do so without success.l Here's what I have, how
can I correct it?
[color=blue][color=green][color=darkred]
>>> X = [1, 2, 3, 4, 5]
>>> Y = [5, 4, 3, 2, 1]
>>> import scipy
>>> scipy.corrcoef( X,Y)[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
File "C:\Python24\Li b\site-packages\numpy\ lib\function_ba se.py", line
671, in corrcoef
d = diag(c)
File "C:\Python24\Li b\site-packages\numpy\ lib\twodim_base .py", line
80, in diag
raise ValueError, "Input must be 1- or 2-d."
ValueError: Input must be 1- or 2-d.[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Thanks in advance
Thomas Philips
tried using SciPy to do so without success.l Here's what I have, how
can I correct it?
[color=blue][color=green][color=darkred]
>>> X = [1, 2, 3, 4, 5]
>>> Y = [5, 4, 3, 2, 1]
>>> import scipy
>>> scipy.corrcoef( X,Y)[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
File "C:\Python24\Li b\site-packages\numpy\ lib\function_ba se.py", line
671, in corrcoef
d = diag(c)
File "C:\Python24\Li b\site-packages\numpy\ lib\twodim_base .py", line
80, in diag
raise ValueError, "Input must be 1- or 2-d."
ValueError: Input must be 1- or 2-d.[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Thanks in advance
Thomas Philips
Comment