apparently .A1 is to flatten np.matrix and does not work with arrays, np.ravel should replace it
.A1
np.matrix
np.ravel