I am using numpy. I have a matrix with 1 column and N rows and I want to get an array from with N elements.
For example, if i have M = matrix([[1], [2], [3], [4]])
, I want to get A = array([1,2,3,4])
.
To achieve it, I use A = np.array(M.T)[0]
. Does anyone know a more elegant way to get the same result?
Thanks!
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…