'how to calculate the correlation of two two-dimensional arrays?

I have two 100x100 2D arrays a and b, and I want to calculate the total correlation of a and b, returning an r and a p.

I did this in matlab with corrcoef, but I don't seem to find anything like it in python. (https://ww2.mathworks.cn/help/matlab/ref/corrcoef.html?requestedDomain=cn)

DataFrame.corrwith or numpy.corrcoef seem to return row correlation or column correlation, is there a function that can return the total correlation directly? I searched on stack for a long time and didn't see a suitable solution.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source