ok with n_short_events :

n_short_events = np.sum(np.sum(np.diff(events[:, 0]) <= short_event_warn)

n_single is not clear to me.