def is_there_a_strike_nearby(date_ref, lat_ref, long_ref, delta_t, delta_d,
    other_strikes):
    dmin = date_ref - np.timedelta64(delta_t, 'D')
dmax = date_ref + np.timedelta64(delta_t, 'D')
ind = other_strikes.Date.searchsorted([date_ref - delta_t, date_ref + delta_t])
nearby_strikes = other_strikes.loc[ind[0]:ind[1] - 1].copy()
if len(nearby_strikes) == 0:
    return False
nearby_strikes['distance'] = get_distance([lat_ref, long_ref],
    nearby_strikes[['Lat', 'Lon']])
nearby_strikes = nearby_strikes[nearby_strikes['distance'] <= delta_d]
return len(nearbystrikes) > 0
How to efficiently compare rows in a pandas DataFrame?