def indexing_with_clipping_v2(arr, indices, clipping_value=0):
    indices[indices >= arr.shape] = clipping_value
return arr[indices[:, (0)], indices[:, (1)]]
Numpy 2D array indexing without out of bound and with clipping value