To analyze a system using NetworkX, that system must first be modeled as a network, and then be represented as an object within NetworkX. This chapter explains the basic process of creating network representations of data. The first section covers the part of the process that takes place in your head: modeling data as a network. The remaining sections demonstrate the part of the process that happens in code: creating a NetworkX Graph from data, using two different methods. In the first method, data is reformatted into one of the standard network formats supported by NetworkX. In the second method, for more complex data, a network is created from scratch, by using code to add nodes and edges one at a time.
In this chapter, we will cover the following topics:
- Modeling data: Giving meaning to nodes and edges
- Network files: Saving your networks to files
- Networks...