Try corrcoef
. It will return a 2*2 matrix with the non-diagonal element correlation coefficient between the two matrices:
import numpy as np
A = np.matrix('1 1; 1 0')
B = np.matrix('1 0; 1 0')
cor = np.corrcoef(A.reshape(-1), B.reshape(-1))[0][1]
print cor