Turn v from shape (4,) into a column of shape (4, 1)

NumPy · from Adding, removing and moving axes

np.newaxisnp.expand_dims.squeeze()np.swapaxesnp.moveaxis.transpose(axes)

Putting the kettle on…

Starting up…

Exercise 1

Turn v from shape (4,) into a column of shape (4, 1).

your answer
stuck? the lesson behind it
Adding, removing and moving axes
newaxis, squeeze, moveaxis — the tools for making shapes line up.