One vs Two Dimensional Array
import numpy as np
a = np.array([1, 2, 3, 4])
a
array([1, 2, 3, 4])
a.shape
(4,)
b = np.array([
[1], [2], [3], [4]
])
b
array([[1],
[2],
[3],
[4]])
b.shape
(4, 1)
Diff between (4, ) and (4, 1)
The difference between (4,) and (4,1) is that the first is the shape of a one-dimensional array, while the second is the shape of a 2-dimensional array whose 2nd dimension has length 1.