Compute Pearson's r between two arrays.
Constraints
Example
>>> correlation_coefficient([1,2,3],[4,5,6]) 1.0 >>> correlation_coefficient([1,2,3],[6,5,4]) -1.0 >>> correlation_coefficient([1,2,3],[2,4,6]) 1.0 >>> correlation_coefficient([1,2,3],[1,2,3]) 1.0 >>> correlation_coefficient([1,2,3],[3,1,2]) -0.5 >>> correlation_coefficient([1,2,3],[1,1,1]) 0.0
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints