how to make a matrix from arrays python code example Example: from matrix to array python np.array(M).ravel()