I have ndarray of 3 dimension. How do I select index 0 and 1 from first axis while selecting index 0 and 3 from second axis and index 1 from third axis?
I tried to use index [(0,1), (1, 3), 1], which produces a result completely different than what I thought it would produce.
So two questions here. What does [(0,1), (1, 3), 1] do? And how to correctly create an index that solve my original question.
a = np.arange(30).reshape(3, 5, 2)
array([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9]],
[[10, 11],
[12, 13],
[14, 15],
[16, 17],
[18, 19]],
[[20, 21],
[22, 23],
[24, 25],
[26, 27],
[28, 29]]])
a[0, (1, 3), 1] # produces array([3, 7])
a[(0,1), (1, 3), 1] # produces array([ 3, 17])
```