networkx
Network Analysis Tutorial using Python & MSCX Ph.D. Summer School, Salina (ME) - Italy
Author: Valerio Maggio
PostDoc Data Scientist @ FBK/MPBA
Contacts:
@leriomaggio | vmaggio_at_fbk_dot_eu |
Get Started
Binder
(Consider this option only if your WiFi is stable)
If you don't want the hassle of getting setup, you can use the Binder service to participate in the live tutorial. Just click on the button below:
Setup the Environment
Clone this repo
git clone https://github.com/leriomaggio/network-analysis-mscx18.git
Requirements
This tutorial will use Python 3
This tutorial requires the following packages:
-
Python version 3.6
- Python 3.4+ should be fine as well
- likely Python 2.7 would be also fine, but who knows? :P
-
matplotlib==2.2.3
-
networkx==2.1
-
pandas==0.23.0
-
hiveplot==2017.10.17.21.7
-
nxviz==0.5.0
-
numpy==1.14.3
-
jupyter==1.0.0
-
scipy==1.1.0
-
python-louvain==0.11
-
bokeh==0.13.0
Easiest way: Anaconda Distribution of Python
If you have the Anaconda distribution of Python 3 installed on a Unix-like machine (Linux, macOS, etc.), then run make conda
, which wraps the commands below.
$ conda env create -f environment.yml
$ source activate nams
$ python checkenv.py
If you do not have the Anaconda distribution, I would highly recommend getting it for
Windows, Mac or Linux. It provides an isolated Python computing environment
that will not interfere with your system Python installation, and comes with a very
awesome package manager (conda
) that makes installation of new packages a single conda install pkgname
away.
pip install
Alternative to Anaconda: For those who do not have the capability of installing the Anaconda Python 3 distribution on their computers, please follow the instructions below.
Run make venv
, which wraps up the commands below.
- Create a virtual environment for this tutorial, so that the installed packages do not mess with your regular Python environment.
$ pip install virtualenv
$ virtualenv mscx
$ source mscx/bin/activate
$ pip install matplotlib networkx pandas hiveplot numpy jupyter
Check your environment:
$ python checkenv.py
Run the Jupyter Notebook
$ jupyter notebook
Dataset References
Resources
- Jon Charest's use of Circos plots to visualize networks of Metal music genres. [blog post][5] | [notebook][6]
- Gain further practice by taking this course online at DataCamp!
- A gentle introduction to graph theory on Vaidehi Joshi's website