Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Advanced Indexing For 2D Numpy Array

$
0
0

I have a 2D numpy array of size [N, M] = A.I'm trying to select an element from each row based on some criteria.I already have all the indices in an array of size [N, 1] = B, where each element in this array is in [0, M).That is, each number in B indicates the position of the element in each row to be selected.I've already tried A[B], but it didn't work as expected.


Viewing all articles
Browse latest Browse all 23131

Trending Articles