indexers = np.unique(np.concatenate([np.arange(max(i - n, 0), min(i + n,
    len(df))) for i in df[df.event == 'ping'].index]))
How can I select all DataFrame rows that are within a certain distance of a given value in a specific column?