not sure but is it possible to write this more compactly as `events_out[events[:, col] == ii, col] = new_id ` ?