Compute the matrix of pairwise Pearson correlations between the columns of a data matrix.
Implement solve(X).
Returns. Return a symmetric d×d NumPy array with ones on the diagonal. A constant column has no variance, so its correlations are nan.
Example 1
Input:
solve([[1.0, 2.0], [2.0, 4.0], [3.0, 6.0]])
Output:
[[1.0, 1.0], [1.0, 1.0]]
Example 2
Input:
solve([[1.0, 3.0], [2.0, 2.0], [3.0, 1.0]])
Output:
[[1.0, -1.0], [-1.0, 1.0]]
No results yet
Run your code to check it against the examples, or submit to run every test.