mask = mask_x & mask_y & mask_z
indices = np.where(mask)
dts = dts[indices]
max_dist = max(abs(target_x - 100), abs(target_y - 100))
elem = int(min(np.ceil(((max_dist + 50)/100) * (len(dts) - 1)), len(dts) - 1))
z_filter = sorted(dts[:, 2])[elem]
minind = np.argmin(np.linalg.norm(dts[:, :3] - np.array([[0.0, 0.0, z_filter]]), axis=1))
arr = np.expand_dims(dts[minind], axis=1).T
In the above code snippet, the value of indices is becoming an empty list for some examples in the nuscenes dataset(scene no - 4, 419) and thus z_filter computation is giving the out-of-index error.
Please suggest a solution to it.