Closed woshihuxingtan closed 10 years ago
When you use a module function you need to call it using the module. For example:
module.function(parameters)
In you case you are missing the module and the interpreter will look into your current script for the centrality function. If the function is in networkx module the:
networkx.betweenness_centrality(graph)
thanks alot! @mramire8 nx.betweenness_centrality(graph) works
I looked the NetworkX documentation, there is a function used for computing betweenness centrality for nodes in a bipartite network.
betweenness_centrality(G, nodes)
Parameters :
G : graph A bipartite graph
nodes : list or container Container with all nodes in one bipartite node set.
Returns :
betweenness : dictionary Dictionary keyed by node with bipartite betweenness centrality as the value.
I have tried to used it, but it shows a Name Error as follow:
Do I need to import extra library to let it work? Or I just choose an inappropriate function?