NetworkX

Previous topic

networkx.readwrite.nx_yaml.write_yaml

Next topic

networkx.readwrite.nx_yaml.write_yaml

networkx.readwrite.nx_yaml.read_yaml

networkx.readwrite.nx_yaml.read_yaml(path)

Read graph in YAML format from path.

YAML is a data serialization format designed for human readability and interaction with scripting languages [R198].

Parameters :

path : file or string

File or filename to read. Filenames ending in .gz or .bz2 will be uncompressed.

Returns :

G : NetworkX graph

References

[R198](1, 2) http://www.yaml.org

Examples

>>> G=nx.path_graph(4)
>>> nx.write_yaml(G,'test.yaml')
>>> G=nx.read_yaml('test.yaml')