Tweeted By @python_tip
You can select elements of 2d #numpy array by lists of row and column indices
— Daily Python Tip (@python_tip) May 13, 2019
>>> x = np.arange(9).reshape((3, 3))
>>> x
array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
>>> x[[0,2,2], [1,0,2]]
array([1, 6, 8])
For details: https://t.co/LKY2rj9l8l