ping = pd.Series(np.where(df.event == 'ping', True, np.where(df.event.shift
    (1) == 'ping', True, np.where(df.event.shift(-1) == 'ping', True, False
    ))), index=df.index)
How can I select all DataFrame rows that are within a certain distance of a given value in a specific column?