changing the values of the diagonal of a matrix in numpy,A.ravel()[:A.shape[1] ** 2:A.shape[1] + 1]