你可以用 reshape -
reshape
u0 = [1, 2, 3] np_u0_row = np.array(u0) np_u0_col = np_u0_row.reshape((1, len(u0))) print(np_u0_col.shape) # (1, 3)