I am having issues flatting the following matrix into an array
np.matrix([[1],
[2],
[3]])
More generally this matrix will be n,1
shape
The goal is to get it to be in a 3,
form like [1, 2, 3]
however I am finding that difficult. Every operation I can find returns a matrix or does not work.
x = np.matrix([[1],
[2],
[3]])
x.flatten()
>>>matrix([[1, 2, 3]])
x.ravel()
>>>matrix([[1, 2, 3]])
x.ravel()[0,:]
>>>matrix([[1, 2, 3]])
np.reshape(x, 3)
>>>matrix([[1, 2, 3]])
x.flatten()[0]
>>>matrix([[1, 2, 3]])
How can I get this one row-ed matrix into a vector?