This documents the development version of NetworkX. Documentation for the current release can be found here.
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 .
A NetworkX graph
- path_for_yaml_outputfile 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.
Deprecated since version 2.6.
>>> G = nx.path_graph(4) >>> nx.write_yaml(G, "test.yaml")