Unable to import centrality function
Sir, I am unable to import centrality function from the graph tool package *import graph_tool as gt* *gt.centrality.eigenvector(myGraph)* gives the following error: *AttributeError: module 'graph_tool' has no attribute 'centrality'* I tried after restarting my Spyder IDE but the issue remains I am using graph tool version '2.27 (commit ce258562, Thu Jun 28 14:29:44 2018 +0100)' OS: Linux (Ubuntu 64bit) -- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
Hi, I don't think you're supposed to do "gt.centrality.eigenvector(MyGraph)". Did you try "gt.eigenvector(MyGraph)"? On 10/4/18 8:08 AM, ashutosh wrote:
Sir,
I am unable to import centrality function from the graph tool package
*import graph_tool as gt*
*gt.centrality.eigenvector(myGraph)*
gives the following error:
*AttributeError: module 'graph_tool' has no attribute 'centrality'*
I tried after restarting my Spyder IDE but the issue remains
I am using graph tool version '2.27 (commit ce258562, Thu Jun 28 14:29:44 2018 +0100)'
OS: Linux (Ubuntu 64bit)
-- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/ _______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
Yes, I tried this too but it doesn't work. *gt.eigenvector(MyGraph)* doesn't work. It's not listed in the list of modules inside graph_tool package. Also documentation specifically mentions *graph_tool.centrality.eigenvector(g, weight=None, vprop=None, epsilon=1e-06, max_iter=None)* that is the command has to be called inside the centrality module of graph tool package. -- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
Am 04.10.18 um 07:08 schrieb ashutosh:
*import graph_tool as gt*
*gt.centrality.eigenvector(myGraph)*
gives the following error:
*AttributeError: module 'graph_tool' has no attribute 'centrality'*
In Python, you must first import a module before it can be used. Thus before using graph_tool.centrality.eigenvector, you must do: import graph_tool.centrality As is explained in the graph-tool documentation, the library includes the graph_tool.all submodule that includes every function. Thus you can also do import graph_tool.all as gt and then use directly gt.eigenvector(). Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (3)
-
ashutosh -
Ozgun Altunkaya -
Tiago de Paula Peixoto