Commit 4bcfb3ba authored by Tiago Peixoto's avatar Tiago Peixoto

Graph.add_edge_list(): Add docstring example

parent c9dd78bc
Pipeline #645 passed with stage
in 138 minutes and 21 seconds
......@@ -2369,7 +2369,22 @@ class Graph(object):
maps that will be filled with the remaining values at each row, if there
are more than two.
Examples
--------
>>> edge_list = [(0, 1, .3, 10), (2, 3, .1, 0), (2, 0, .4, 42)]
>>> g = gt.Graph()
>>> eweight = g.new_ep("double")
>>> elayer = g.new_ep("int")
>>> g.add_edge_list(edge_list, eprops=[eweight, elayer])
>>> print(eweight.fa)
[0.3 0.1 0.4]
>>> g.get_edges()
array([[0, 1],
[2, 3],
[2, 0]])
"""
if eprops is None:
eprops = ()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment