This question already has answers here:
Closed 9 days ago.
I have the following array:
import numpy as np
print(A)
array([[ 0, 1, 4, 5, 8, 7],
[ 5, 3, 4, 1, 8, 11],
[ 2, 7, 5, 3, 4, 1],
[ 2, 8, 8, 1, 10, 1],
[ 2, 14, 8, 6, 5, 3]])
And I need to the values A
corresponding to these column indices:
b = np.array([5, 0, 3, 4, 4])
Expected output:
array([ 7, 5, 3, 10, 5])
Thanks in advance.