Numpy matrix to array Numpy matrix to array python python

Numpy matrix to array


If you'd like something a bit more readable, you can do this:

A = np.squeeze(np.asarray(M))

Equivalently, you could also do: A = np.asarray(M).reshape(-1), but that's a bit less easy to read.


A, = np.array(M.T)

depends what you mean by elegance i suppose but thats what i would do