I have a 4d array to mask and a 2d array to mask index.
i should masking ndarray data using 2d array indices and i dont want to using for-loop. how should i do?
for example,
mask_arr = np.random.rand(5,10,100)
idx_arr = np.random.randint(10, size=(5,5))
and my masking code like this using for-loop
mask_val = 0
for i in range(5):
mask_arr[i, idx_arr[i],:] = mask_val