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