NetworkX provides support for reading and writing many network file formats. Of course, if a network has been provided in one of these formats, it will be very easy to load into NetworkX! But, even if you have data in another format, it is often possible to convert it to one of the supported formats without too much difficulty (I would guess that 90% of network science work is converting data between formats most of the rest is complaining about converting data). Spreadsheets, for instance, can often be converted to an appropriate format just by reordering columns and exporting as tab-separated values (TSV format). This section will describe several common formats, including adjacency list, edge list, GEXF, ...
Reading and writing network files
Get Network Science with Python and NetworkX Quick Start Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.