Hi!
what is the graph-toolic way of working with a GraphView other than for drawing?
I find the filtering functionality pretty neat and would like to do things like
babo = load_graph('babonet.gt')
babo_in_hist = vertex_hist(babo, 'in')
chabo = GraphView(g, efilt=lambda e: g.ep.chabo_prop[e] == 'WISSEN_WER')
chabo_in_hist = vertex_hist(chabo, 'in')
Yet babo_in_hist == chabo_in_hist evaluates to True, which makes sense because chabo knows who the babo is (they share the same basis data).
I can come up with a way of building an extra network based on the GraphView, but this seems like something somebody else has already needed so I figured I better ask first (obviously after having checked the mailing list archive ;) )
Have a nice weekend everybody!
Juan Dominguez-Moran
________________________________________
Von: graph-tool <graph-tool-bounces(a)skewed.de> im Auftrag von graph-tool-request(a)skewed.de <graph-tool-request(a)skewed.de>
Gesendet: Freitag, 5. Oktober 2018 12:00
An: graph-tool(a)skewed.de
Betreff: graph-tool Digest, Vol 129, Issue 3
Send graph-tool mailing list submissions to
graph-tool(a)skewed.de
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.skewed.de/mailman/listinfo/graph-tool
or, via email, send a message with subject or body 'help' to
graph-tool-request(a)skewed.de
You can reach the person managing the list at
graph-tool-owner(a)skewed.de
When replying, please edit your Subject line so it is more specific
than "Re: Contents of graph-tool digest..."
Today's Topics:
1. Re: Unable to import centrality function (Ozgun Altunkaya)
2. Re: Unable to import centrality function (ashutosh)
----------------------------------------------------------------------
Message: 1
Date: Thu, 4 Oct 2018 21:24:58 +0300
From: Ozgun Altunkaya <altunkayao(a)itu.edu.tr>
To: graph-tool(a)skewed.de
Subject: Re: [graph-tool] Unable to import centrality function
Message-ID: <9c039269-5d2b-9799-f559-ba688b4e6b51(a)itu.edu.tr>
Content-Type: text/plain; charset=utf-8; format=flowed
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(a)skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
>
------------------------------
Message: 2
Date: Thu, 4 Oct 2018 20:20:59 -0700 (MST)
From: ashutosh <ashuein(a)gmail.com>
To: graph-tool(a)skewed.de
Subject: Re: [graph-tool] Unable to import centrality function
Message-ID: <1538709659461-0.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
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/
------------------------------
Subject: Digest Footer
_______________________________________________
graph-tool mailing list
graph-tool(a)skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool
------------------------------
End of graph-tool Digest, Vol 129, Issue 3
******************************************
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/
I'd like to use the "add_edge_list" function to add edges to my graph, and
simultaneously assign a value for an edge property map for each of the added
edges.
When I try the following example (with no edge property map information)
works fine:
elist1 = np.array([[0,1], [1, 2]]) #edge list with no value for edge
property map data (only the source and target for the edges)
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist)
But with the following example, I get the error below:
elist2 = np.array([[0,1, 1], [1, 2, 0]]) #edge list with edge property map
value in 3rd column
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist2, eprops=my_eprop)
Error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-48-6a949ea52c9b> in <module>()
----> 1 g.add_edge_list(elist2, eprops=my_eprop)
/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in
add_edge_list(self, edge_list, hashed, string_vals, eprops)
1969 eprops = ()
1970 else:
-> 1971 convert = [_converter(x.value_type()) for x in eprops]
1972 eprops = [_prop("e", self, x) for x in eprops]
1973 if not isinstance(edge_list, numpy.ndarray):
/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in
__getitem__(self, k)
534 kt = "Graph"
535 raise ValueError("invalid key '%s' of type '%s',
wanted type: %s"
--> 536 % (str(k), str(type(k)), kt) )
537
538 def __setitem__(self, k, v):
ValueError: invalid key '0' of type '<type 'int'>', wanted type: Edge
---------------------------------------------------------------------------
Please help!
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.