基于已经存在的stackoverflow post( here )您可以执行以下操作:
import numpy as np list1 = [2,4,6,8,10] array1 = np.array(list1)[np.newaxis] print(array1) print(array1.transpose())
对于以上代码,您可以在此处看到输出: