Say I want to multiply a matrix by a vector:
[1 2 3] [10]
[4 5 6] * [11]
[7 8 9] [12]
In Python using Numpy I would do it like this:
from numpy import *
A = matrix(
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
B = matrix(
[[10], [11], [12]])
print(A * B)
However as you can see, in order to define matrix B correctly, I have to type [[10], [11], [12]]
, and that is a bit tedious. Is there something that just constructs a vector, so I could type something like vector([10, 11, 12])
instead of matrix([[10], [11], [12]])
?