I have a matrix m = np.matrix([[1, 2, 3], [4, 5, 6]])
.
I extract a vector v = m[0] + m[1]
, so that now v == [[5, 7, 9]]
. The vector's shape is (1, 3)
, meaning it's considered a matrix, not a vector. How can I make v
an actual vector, i.e something of shape (3,)
?
I tried to use np.asarray(v)
and np.array(v)
but they don't do what I want.