np.zeros((120, 160, 3)) is an image

NumPy · from Adding, removing and moving axes

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

Putting the kettle on…

Starting up…

Exercise 4

np.zeros((120, 160, 3)) is an image. Move the channel axis to the front and return the resulting shape.

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