Read a graph as list of edges with numeric weights.
Parameters : | path : file or string
comments : string, optional
delimiter : string, optional
create_using : Graph container, optional,
nodetype : int, float, str, Python type, optional
encoding: string, optional :
|
---|---|
Returns : | G : graph
|
Notes
Since nodes must be hashable, the function nodetype must return hashable types (e.g. int, float, str, frozenset - or tuples of those, etc.)
Example edgelist file format.
With numeric edge data:
# read with
# >>> G=nx.read_weighted_edgelist(fh)
# source target data
a b 1
a c 3.14159
d e 42