Skip to content

Instantly share code, notes, and snippets.

@cuckookernel
Last active July 16, 2018 15:30
Show Gist options
  • Save cuckookernel/900649520a0ff1cce704436595b10c18 to your computer and use it in GitHub Desktop.
Save cuckookernel/900649520a0ff1cce704436595b10c18 to your computer and use it in GitHub Desktop.
final_result = ( pairs_filtered[['stalkee', 'stalker', 'location_id']]
.unique()
.groupby( ['stalkee','stalker'] ,
{"location_count" : agg.COUNT })
.topk( 'location_count', k=5 )
.materialize() )
print( final_result )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment