Skip to content

Instantly share code, notes, and snippets.

@tomasonjo
Created May 19, 2022 13:32
Show Gist options
  • Save tomasonjo/bd2fc12f2b493ea2e5dcd88bb9559e29 to your computer and use it in GitHub Desktop.
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