Skip to content

Instantly share code, notes, and snippets.

@tomasonjo
Last active May 25, 2022 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomasonjo/9777dcd688d687115f480863c0ef6165 to your computer and use it in GitHub Desktop.
Save tomasonjo/9777dcd688d687115f480863c0ef6165 to your computer and use it in GitHub Desktop.
# Pagerank centrality
pr = gds.pageRank.stream(G, nodeLabels=['User'],
relationshipTypes=['P2P'], relationshipWeightProperty='totalAmount')
pr['pagerank'] = pr['score']
graph_features = graph_features.merge(pr[['nodeId', 'pagerank']], on='nodeId')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment