Skip to content

Instantly share code, notes, and snippets.

@cuckookernel
Created July 16, 2018 14:12
Show Gist options
  • Save cuckookernel/930b600d31780bee21c7c9fa0f0aae4d to your computer and use it in GitHub Desktop.
Save cuckookernel/930b600d31780bee21c7c9fa0f0aae4d to your computer and use it in GitHub Desktop.
chin_ps = ( checkins.join( checkins, on = 'location_id' )
.rename( {'checkin_ts' : 'checkin_ts_ee',
'checkin_ts.1' : 'checkin_ts_er',
'user_id' : 'stalkee' ,
'user_id.1' : 'stalker' } ) )
pairs_filtered = chin_ps[ (chin_ps['checkin_ts_ee'] < chin_ps['checkin_ts_er']) &
(chin_ps['stalkee'] != chin_ps['stalker]) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment