write_yaml(G_to_be_yaml, path_for_yaml_output, **kwds)¶
Write graph G in YAML format to path.
YAML is a data serialization format designed for human readability and interaction with scripting languages 1.
G (graph) – A NetworkX graph
path (file or string) – File or filename to write. Filenames ending in .gz or .bz2 will be compressed.
To use encoding on the output file include e.g.
encoding='utf-8'in the keyword arguments.
>>> G = nx.path_graph(4) >>> nx.write_yaml(G, "test.yaml")