NumPy vs Linear Algebra
I quickly noticed that "Vector" in programming languages ≠ "vector" in mathematics" and that "you should rather learn how to translate math to the code."
Particularly, NumPy's notion of vectors and and their transposition differs from that in linear algebra.
I'll be referring to this post (partially quoted below) in the future.
For example, transposing a NumPy array of shape (a,b,c,d) returns an array of shape (d,c,b,a) -- the axes are reversed. In two dimensions, this means an array of shape (a,b) (i.e. a rows, b columns) becomes an array of shape (b,a) (i.e, b rows, a columns). So NumPy's notion of transposition matches up nicely with the linear algebra notion for 2-dimensional arrays.
NumPy apes the concept of row and column vectors using 2-dimensional arrays. An array of shape (5,1) has 5 rows and 1 column. You can sort of think of this as a column vector, and wherever you would need a column vector in linear algebra, you could use an array of shape (n,1). Similarly, wherever you see a row vector in linear algebra you could use an array of shape (1,n)











