Questions tagged [numpy-indexing]

questions related to indexing on numpy ndarray objects

ndarrays can be indexed using the standard Python x[obj] syntax, where x is the array and obj the selection. There are different kinds of indexing available depending on obj: basic indexing, advanced indexing and field access.

Read more:

62 questions
-1
votes
2 answers

numpy index array throws out of bounds exception

Can somebody please point out the error in the code below? The last line keeps throwing an error: tmp = img1[coords] IndexError: index 409 is out of bounds for axis 0 with size 352 I'm only shifting the indices by 10 so I don't understand how I'm…
deekay42
  • 616
  • 1
  • 6
  • 19
-2
votes
2 answers

What is meant by indexing a numpy array with a conditional statement based on itself?

I'm working on a large library for network analysis and have come across a perplexing line whose calling convention I'm not familiar with. monitors = [1,2,3,4] nmonitors = 7 # This value is passed arbitrarily to the function while…
1 2 3 4
5