Premium problem117. Correlation Matrix Between Rows

Medium Locked

Treat each row of 2-D array X as a variable. Return the Pearson correlation coefficient matrix between all rows.

Input

[[1 0 0 3 1]
 [3 6 6 2 9]
 [4 5 3 8 0]]

Output

[[ 1.         -0.58848989  0.56011203]
 [-0.58848989  1.         -0.8652532 ]
 [ 0.56011203 -0.8652532   1.        ]]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)