Re:NumPy 1.20
by 6gvONxR4sf7o on Sunday January 31, 2021 @11:33AM
(#25979954)
Does that work the same way with strided arrays?
Re:NumPy 1.20
by montebicyclelo on Sunday January 31, 2021 @01:48PM
(#25981356)
Assuming you mean what I think you mean, it does work.
e.g. a[::2, ::3].flat[idx], where idx is from 0 to width*height of the view
(idx can also be a NumPy array, for getting multiple values)
a = np.array([[1,2,3],[1,9,3],[1,2,3]])
idx = np.argmax(a)
a.flat[idx] # 9