I have a numpy array:
X = np.array([[1,0,1],
[1,1,1],
[0,1,0],
[1,0,1]])
which has a shape of (4,3)
I would like to change this shape into (4,4)
by adding 1 to the second dimension of the array, via:
X_b = np.ones((X.shape+(0,1)))
but what I get is:
ValueError: could not broadcast input array from shape (4,3) into shape (4,2,0,1)
What is the right way to do it?
Basically I want X_b
to have a shape of (4,4)
if X.shape = (4,3)