Skip to content

Retrieve all modules a physical node is assigned to in python API #272

Answered by danieledler
u-xixi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @u-xixi,

For a multilayer network, you can access the node_id and layer_id together with module_id when you iterate the (state) nodes:

for node in im.nodes:
    print(node.node_id, node.layer_id, node.module_id)

This will give you overlapping modules, as the same node_id may occur multiple times for different layer_id.

See this example.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by u-xixi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants