Difference between Numpy (n,) and (n, 1) notation [Difference between horizontal vector and vertical vector]
Introduction
If you look at the shape of the Numpy ndarray array, you'll see notations such as (n, 1) and (n,). I wondered, "Isn't [,] or [1] unnecessary for a one-dimensional array?"
Conclusion
(n,) is an array of horizontal vectors (just a one-dimensional array)
(n, 1) is an array of vertical vectors
- One-dimensional arrays cannot be converted to transpose with .T, so reshape must be used.