Skip to content

Instantly share code, notes, and snippets.

@tomasonjo
Created May 19, 2022 13:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tomasonjo/bd2fc12f2b493ea2e5dcd88bb9559e29 to your computer and use it in GitHub Desktop.
# Closeness centrality
bc = gds.beta.closeness.stream(G, nodeLabels=['User'], relationshipTypes=['P2P'])
bc['closeness'] = bc['score']
graph_features = graph_features.merge(bc[['nodeId', 'closeness']], on='nodeId')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment