Skip to content

drdeford/JMM2021NetworkX

Repository files navigation

Python Tutorial on Network(x)

Home for the materials (notebooks, data, and commentary) associated to the introductory tutorial at the 2021 JMM Short Course on Mathematical and Computational Methods for Complex Social Systems. This tutorial is intended to provide a starting point for working with graphs and networks in Python and doesn't assume any specific programming background. The intended outline is approximately:

  • How do Jupyter notebooks work?
  • Building and plotting Ego graphs
  • Loading and processing larger graphs
  • Centrality comparisons and null models
  • Dynamics on networks

with the goal of providing lots of examples and opportunities for attendees to experiment.

Installation Instructions

The Python Install .pdf above provides some links and instructions for getting started with python on your own computer. If you would prefer not to install anything now, you can still follow along by either using the directions in that same .pdf for opening the notebooks with one of the cloud services or by simpling clicking the corresponding links above. For attendees with more experience or Python background the main short course webpage has an environment prepared for this material.

Notebooks

The main material we will be discussing in the tutorial is contained in the four Jupyter notebooks presented above.

  • 0_Jupyter_Basics.ipynb This notebook walks through the basic usage of Jupyter notebooks and how to interact with Python cells. It also includes examples of basic arithmetic, variable assignment, data types, data structures, and imports work in Python as well as a couple of exercises to check your understanding. If you already have some familiarity with Python, this one is safe to skip :)
  • 1_Ego_Networks.ipynb This notebook explores the basic properties of the Graph object in networkx by directly constructing ego networks. We will see how to access properties of the corresponding nodes and edges and visualize the networks using the draw function.
  • 2_Social_Networks.ipynb In this notebook we will examine how to work with larger and more complex networks and evaluate the results of graph algorithms, including centrality calculations. The main motivating examples will show some of the common properties of social networks and how they differ from structured combinatorial graphs and random network models.
  • 3_Network_Dynamics.ipynb In the final notebook we will put everything together, looking at how to model random walks, heat diffusion, and epidemiological disease spreading using networkx.

Other Resources

One hour isn't nearly enough time to explore all of the facets of networkx, so here are some good starting places if you are interested in learning more:

About

Notebooks for introduction to NetworkX session

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages