Identifying groups of two rows that satisfy three conditions in a dataframe
问题 I have the df below and want to identify any two orders that satisfy all the following condtions: Distance between pickups less than X miles Distance between dropoffs less Y miles Difference between order creation times less Z minutes Would use haversine import haversine to calculate the difference in pickups for each row and difference in dropoffs for each row or order. The df I currently have looks like the following: DAY Order pickup_lat pickup_long dropoff_lat dropoff_long created_time 1