From np.array([1, 2, 3]), produce [1, 1, 2, 2, 3, 3] — each element doubled in…
NumPy · from Joining and splitting arrays
np.concatenatenp.stacknp.vstacknp.hstacknp.splitnp.tilenp.repeatPutting the kettle on…
Starting up…
Exercise 4
From np.array([1, 2, 3]), produce [1, 1, 2, 2, 3, 3] — each element doubled in place.
your answer
stuck? the lesson behind it
Joining and splitting arrays
concatenate extends an axis; stack creates one. Everything else is shorthand.