Return just two elements of a: the one at (0, 3) and the one at (2, 0)

NumPy · from Fancy indexing

a[[0, 2]]a[rows, cols]np.ix_np.takenp.add.atalways copies

Putting the kettle on…

Starting up…

Exercise 3

Return just two elements of a: the one at (0, 3) and the one at (2, 0). The result should be a 1-D array of length 2.

your answer
stuck? the lesson behind it
Fancy indexing
Indexing with a list of positions — and why two lists zip instead of crossing.