Let’s say I have a NumPy array, a:
a
a = np.array([ [1, 2, 3], [2, 3, 4] ])
And I would like to add a column of ze
For me, the next way looks pretty intuitive and simple.
zeros = np.zeros((2,1)) #2 is a number of rows in your array. b = np.hstack((a, zeros))