correlation
numpy.corrcoef: Pearson product-moment correlation coefficients
code:python
from numpy import np
code:python
print(np.corrcoef(T,P,rho)) # correlation matrix of T,P and rho Use numpy.ma.corrcoef for masked array
The Glowing Python: Visualizing correlation matrices
pandas.Series.corr
pandas.DataFrame.corr
pandas.DataFrame.corrwith
heatmap
Plotting a diagonal correlation matrix
Seabornで相関をヒートマップにする(行・列を並び替えながら) / Heatmap using Seaborn (order rows and columns as you like) - Qiita
clustermap
Multi-dimension
code:python
def calculate_correlation_nd(data1, data2, axis = 0):
assert data1.shape == data2.shape
view1 = data1
view2 = data2
if axis:
view1 = np.rollaxis(data1, axis)
view2 = np.rollaxis(data2, axis)
data1_norm = (view1 - data1.mean(axis=axis)) / data1.std(axis=axis)
data2_norm = (view2 - data2.mean(axis=axis)) / data2.std(axis=axis)
return np.sum(data1_norm * data2_norm / float(nt), axis=0)
from numpy.corrcoef returns 1 when applied on 2 matrices. · Issue '#4819 · numpy/numpy · GitHub
python - Computing the correlation coefficient between two multi-dimensional arrays - Stack Overflow
See also