Stack p and q along a new axis so the result is (2, 2, 2)

NumPy · from Joining and splitting arrays

np.concatenatenp.stacknp.vstacknp.hstacknp.splitnp.tilenp.repeat

Putting the kettle on…

Starting up…

Exercise 3

Stack p and q along a new axis so the result is (2, 2, 2).

your answer
stuck? the lesson behind it
Joining and splitting arrays
concatenate extends an axis; stack creates one. Everything else is shorthand.