How to make a NumPy array a column vector in Python

Making a NumPy array a column vector transposes an array containing a single row. For example, [[1, 2, 3]] as a column vector is [[1], [2], [3]].

Solution for How to make a NumPy array a column vector in Python : You can use numpy.Array.T to make a NumPy array a column vector Define a row vector as an numpy.ndarray. Then apply numpy.ndarray.T to transpose ndarray to a column vector.


how-to-make-a-numpy-array-a-column-vector-in-python