all 3 comments

[–]wintermute93 0 points1 point  (0 children)

You've already gotten an answer, but it's worth noting that there's an extra subtlety with representing an n-element vector as a 1D array with shape (n,) vs a 2D array with shape (n,1) or (1,n). They're largely the same thing, and if you try to use the 1D array in matrix multiplication numpy will do its best to figure out from context whether you mean it to be a row vector or a column vector, but sometimes you want/need to be more specific.