numpy row of matrix as an array code example Example: from matrix to array python np.array(M).ravel()