Xinds = array([1, 2, 3])
Yinds = array([1, 2, 3])
a
a[ix_(Xinds, Yinds)]
a[ix_(Xinds + 1, Yinds)]
Y2inds = array([1, 3, 4])
a[ix_(Xinds, Y2inds)]
a[ix_(Xinds, Y2inds - 1)]
How to cleanly index numpy arrays with arrays (or anything else that supports addition so that it can be offset)