how to convert matrix to numpy array code example Example: from matrix to array python np.array(M).ravel()