Reputation: 21
I want to initialize a Matrix with 3 vectors. The special part about is that I want the vectors to be the columns the matrix.
Vx= np.zeros((npoints,))
Vy=np.zeros((npoints,))
Vz=np.zeros((npoints,))
V=np.matrix(([Vx,Vy,Vz]))
Now the problem here is that the vectors form the rows of the matrix. How can I fix that?
Upvotes: 0
Views: 230
Reputation: 5389
An alternative for unutbu solution is to use np.vstack
or np.hstack
V = np.matrix(np.vstack((Vx, Vy, Vz)).T)
Upvotes: 0