Missed TensorFlow World? Check out the recap. Learn more

nsl.tools.read_tsv_graph

View source on GitHub

Reads the file filename containing graph edges in TSV format.

Aliases:

nsl.tools.read_tsv_graph(filename)

Args:

  • filename: Name of a TSV file specifying the edges of a graph. Each line of the input file should be the specification of a single graph edge in the form source\<TAB\>target[\<TAB\>weight]. If supplied, weight should be a floating point number; if not supplied, it defaults to 1.0. Multiple edges between the same source and target node IDs are combined by picking the edge with the largest weight.

Returns:

A graph represented as a dict: source -> (target -> weight).