From a 2D numpy array Z
, I'd like to remove certain points, at indicies ix, iy
.
ix, iy
are currently sequential lists of the x-index and corresponding y-index, like so:
ix = range(10)
iy = range(10,20,1)
So I'd like Z[0][10]
, Z[1][11]
, etc. put into a new list or array.
What is the best (read: most pythonic) way of doing this? Perhaps there is a better way of finding these indicies so I get an array of [ix,iy], [ix+1,iy+1]
etc.?
I have looked at this question. I don't know how to use the list comprehension syntax of the selected answer for 2 dimensions.