My question is similar to this one
Get value at list/array index or "None" if out of range in Python
but I want to use multidimensional numpy array.
Can this be done without checking the indexes beforehand?
data = np.ones((2,3,4))
idx1 = [0,1]
idx2 = [1,2]
idx3 = [0, 100]
data[idx1, idx2, idx3]
Desired output:
array([1., np.nan])