aryagraph.io.edgelist.write_edgelist#
- aryagraph.io.edgelist.write_edgelist(g: Graph, path: str | PathLike, *, delimiter: str = ',', attrs: bool | Sequence[str] = True, header: bool = True, isolates: bool = True, encoding: str = 'utf-8') None[source]#
Write g as a delimited edge list (CSV by default).
- Parameters:
delimiter –
","(CSV),"\t"(TSV)," "(whitespace-separated), …attrs –
Truewrites one column per edge attribute (the union of all keys, in first-seen order; missing values stay empty),Falsenone, or a list of attribute names.header – Write the
source,target,<attrs>header line.isolates – Also write nodes without edges, as lines with an empty target, so
read_edgelist()restores them. (Other tools may not understand such lines; passFalsefor a pure edge list.)